diff --git a/LIMITATIONS.adoc b/LIMITATIONS.adoc index 96d523f5..fb712d32 100644 --- a/LIMITATIONS.adoc +++ b/LIMITATIONS.adoc @@ -128,6 +128,28 @@ File inclusions are performed before the full parsing takes place. During this p If the file to include has an empty last line, it will be ignored, so it's always a good practice to include a blank line after the `include::` directive in the main document, to avoid side-effects during the "full" parsing. +== Substitutions + +In "normal" paragraphs, Asciidoctor processes the content with the following substitutions, in the following order: + +1. Special characters +2. Quotes +3. Attribute references +4. Replacements +5. Inline macros +6. Post replacements + +However, splitting the "Quotes" and "Inline Macros" in two distinct steps causes troubles in LibAsciidoc, when an inline macro is wrapped in quoted text, or when an inline macro contains quoted attributes. +As a consequence, in "normal" paragraphs, LibAsciidoc processes the content with the following substitutions, in the following order: + +1. Special characters +2. Attribute references +3. Replacements +4. Quotes and Inline macros +5. Post replacements + + + == Symbols and Characters Markup for the mdash and arrow symbols is not recognized. diff --git a/pkg/parser/comment_test.go b/pkg/parser/comment_test.go index bf8122db..f112a0b6 100644 --- a/pkg/parser/comment_test.go +++ b/pkg/parser/comment_test.go @@ -47,7 +47,7 @@ var _ = Describe("comments", func() { It("single line comment within a paragraph", func() { source := `a first line // A single-line comment. -another line // with a comment` +another line // not a comment` expected := types.DraftDocument{ Blocks: []interface{}{ types.Paragraph{ @@ -64,7 +64,7 @@ another line // with a comment` }, []interface{}{ types.StringElement{ - Content: "another line // with a comment", + Content: "another line // not a comment", }, }, }, diff --git a/pkg/parser/document_processing_apply_substitutions.go b/pkg/parser/document_processing_apply_substitutions.go index ce6fc8c3..1fc3b495 100644 --- a/pkg/parser/document_processing_apply_substitutions.go +++ b/pkg/parser/document_processing_apply_substitutions.go @@ -2,6 +2,7 @@ package parser import ( "fmt" + "path/filepath" "strconv" "strings" @@ -53,52 +54,64 @@ func ApplySubstitutions(rawDoc types.RawDocument, config configuration.Configura // applySubstitutions applies the substitutions on paragraphs and delimited blocks (including when in continued list elements) func applySubstitutions(elements []interface{}, attrs types.AttributesWithOverrides, config configuration.Configuration, options ...Option) ([]interface{}, error) { - log.Debug("apply block substitutions") if len(elements) == 0 { return nil, nil } result := []interface{}{} for _, e := range elements { switch e := e.(type) { + case types.ContinuedListItemElement: + r, err := applySubstitutions([]interface{}{e.Element}, attrs, config, options...) + if err != nil { + return nil, err + } + r[0], err = applyAttributeSubstitutionsOnElement(r[0], attrs) + if err != nil { + return nil, err + } + e.Element = r[0] + result = append(result, e) case types.Paragraph: - p, err := applyParagraphSubstitutions(e, attrs, options...) + p, err := applySubstitutionsOnParagraph(e, attrs, options...) if err != nil { return nil, err } result = append(result, p) - case types.DelimitedBlock: - subs := delimitedBlockSubstitutions(e.Kind, config, options...) - if err := applyDelimitedBlockSubstitutions(&e, subs); err != nil { + case types.ImageBlock: + i, err := applySubstitutionsOnImageBlock(e, attrs, options...) + if err != nil { return nil, err } - r, err := applyAttributeSubstitutions(e, attrs) + result = append(result, i) + case types.Section: + s, err := applySubstitutionsOnSection(e, attrs, options...) if err != nil { return nil, err } - result = append(result, r) - case types.ContinuedListItemElement: - r, err := applySubstitutions([]interface{}{e.Element}, attrs, config, options...) - if err != nil { + result = append(result, s) + case types.DelimitedBlock: + subs := delimitedBlockSubstitutions(e.Kind, config, options...) + if err := applySubstitutionsOnDelimitedBlock(&e, subs); err != nil { return nil, err } - r[0], err = applyAttributeSubstitutions(r[0], attrs) + r, err := applyAttributeSubstitutionsOnElement(e, attrs) if err != nil { return nil, err } - e.Element = r[0] - result = append(result, e) + result = append(result, r) default: // no support for element substitution here // so let's proceed with attribute substitutions - e, err := applyAttributeSubstitutions(e, attrs) + e, err := applyAttributeSubstitutionsOnElement(e, attrs) if err != nil { return nil, err } + // e = resolveLocationsOnElement(e, attrs) result = append(result, e) } } if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("after substitutions:") + log.Debug("after all substitutions:") spew.Fdump(log.StandardLogger().Out, result) } return result, nil @@ -123,9 +136,9 @@ func delimitedBlockSubstitutions(kind types.BlockKind, config configuration.Conf } } -// applyDelimitedBlockSubstitutions parses the given raw elements, depending on the given substitutions to apply +// applySubstitutionsOnDelimitedBlock parses the given raw elements, depending on the given substitutions to apply // May return the elements unchanged, or convert the elements to a source doc and parse with a custom entrypoint -func applyDelimitedBlockSubstitutions(b *types.DelimitedBlock, subs []blockSubstitution) error { +func applySubstitutionsOnDelimitedBlock(b *types.DelimitedBlock, subs []blockSubstitution) error { log.Debug("applying delimited block substitutions") for _, sub := range subs { if err := sub(b); err != nil { @@ -152,7 +165,7 @@ func normalBlock(config configuration.Configuration, options ...Option) blockSub for i, e := range b.Elements { if d, ok := e.(types.DelimitedBlock); ok { subs := delimitedBlockSubstitutions(d.Kind, config, options...) - if err := applyDelimitedBlockSubstitutions(&d, subs); err != nil { + if err := applySubstitutionsOnDelimitedBlock(&d, subs); err != nil { return err } b.Elements[i] = d // store back in the elements @@ -254,7 +267,7 @@ func none() blockSubstitution { func parseRawLine(line types.RawLine, options ...Option) ([]interface{}, error) { result := []interface{}{} - log.Debugf("parsing '%s'", line.Content) + log.Debugf("parsing rawline '%s'", line.Content) e, err := ParseReader("", strings.NewReader(line.Content), options...) if err != nil { return nil, err @@ -270,26 +283,26 @@ func parseRawLine(line types.RawLine, options ...Option) ([]interface{}, error) } func parseContent(filename string, content string, options ...Option) ([]interface{}, error) { - log.Debugf("parsing '%s'", content) + // log.Debugf("parsing content '%s'", content) result, err := ParseReader(filename, strings.NewReader(content), options...) if err != nil { return nil, errors.Wrapf(err, "unable to parse '%s'", content) } if result, ok := result.([]interface{}); ok { - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("parsed content:") - spew.Fdump(log.StandardLogger().Out, types.Merge(result)) - } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debug("parsed content:") + // spew.Fdump(log.StandardLogger().Out, types.Merge(result)) + // } return types.Merge(result), nil } return nil, fmt.Errorf("unexpected type of content: '%T'", result) } func serializeBlock(elements []interface{}) (string, error) { - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("serializing elements in a delimited block") - spew.Fdump(log.StandardLogger().Out, elements) - } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debug("serializing elements in a delimited block") + // spew.Fdump(log.StandardLogger().Out, elements) + // } buf := strings.Builder{} for i, elmt := range elements { if l, ok := elmt.(types.RawLine); ok { @@ -305,83 +318,335 @@ func serializeBlock(elements []interface{}) (string, error) { return buf.String(), nil } +// ---------------------------------------------------------------------------- +// Section substitutions +// ---------------------------------------------------------------------------- + +// applies the elements and attributes substitutions on the given section title. +func applySubstitutionsOnSection(s types.Section, attrs types.AttributesWithOverrides, options ...Option) (types.Section, error) { + elements := s.Title + subs := []elementsSubstitutionFunc{ + substituteInlinePassthroughFunc, + substituteSpecialCharactersFunc, + substituteQuotedTextsFunc, // done at the same time as the inline macros + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + substituteReplacementsFunc, + substituteInlineMacrosFunc, // substituteQuotedTextAndInlineMacrosFunc, + // resolveLocationsOnParagraphLines(attrs), + substitutePostReplacementsFunc, + } + var err error + for _, sub := range subs { + if elements, err = sub(elements, attrs, options...); err != nil { + return types.Section{}, err + } + } + s.Title = elements + if s, err = s.ResolveID(attrs); err != nil { + return types.Section{}, err + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("section title after substitution:") + spew.Fdump(log.StandardLogger().Out, s.Title) + } + return s, nil +} + +// applies the elements and attributes substitutions on the given image block. +func applySubstitutionsOnImageBlock(b types.ImageBlock, attrs types.AttributesWithOverrides, options ...Option) (types.ImageBlock, error) { + elements := b.Location.Path + subs := []elementsSubstitutionFunc{ + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + } + var err error + for _, sub := range subs { + if elements, err = sub(elements, attrs, options...); err != nil { + return types.ImageBlock{}, err + } + } + b.Location.Path = elements + b.Location = b.Location.WithPathPrefix(attrs.GetAsStringWithDefault("imagesdir", "")) + if !b.Attributes.Has(types.AttrImageAlt) { + alt := filepath.Base(b.Location.Stringify()) + ext := filepath.Ext(alt) + alt = alt[0 : len(alt)-len(ext)] + b.Attributes = b.Attributes.Set(types.AttrImageAlt, alt) + } + + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("image block after substitution:") + spew.Fdump(log.StandardLogger().Out, b) + } + return b, nil +} + +// applies the elements and attributes substitutions on the given cross reference. +func applySubstitutionsOnExternalCrossReference(r types.ExternalCrossReference, attrs types.AttributesWithOverrides, options ...Option) (types.ExternalCrossReference, error) { + elements := r.Location.Path + subs := []elementsSubstitutionFunc{ + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + } + var err error + for _, sub := range subs { + if elements, err = sub(elements, attrs, options...); err != nil { + return types.ExternalCrossReference{}, err + } + } + r.Location.Path = elements + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("image block after substitution:") + spew.Fdump(log.StandardLogger().Out, r) + } + return r, nil +} + // ---------------------------------------------------------------------------- // Paragraph substitutions // ---------------------------------------------------------------------------- // applies the elements and attributes substitutions on the given paragraph. // Attributes substitution is triggered only if there is no specific substitution or if the `attributes` substitution is explicitly set. -func applyParagraphSubstitutions(p types.Paragraph, attrs types.AttributesWithOverrides, options ...Option) (types.Paragraph, error) { - subs := p.Attributes.GetAsStringWithDefault(types.AttrSubstitutions, "normal") +func applySubstitutionsOnParagraph(p types.Paragraph, attrs types.AttributesWithOverrides, options ...Option) (types.Paragraph, error) { + subs, err := paragraphSubstitutions(p.Attributes.GetAsStringWithDefault(types.AttrSubstitutions, "normal"), attrs) + if err != nil { + return types.Paragraph{}, err + } + elements := p.Lines // apply all the configured substitutions - for _, sub := range strings.Split(subs, ",") { - lines, err := substitution(sub)(p.Lines, options...) - if err != nil { + for _, sub := range subs { + var err error + if elements, err = sub(elements, attrs, options...); err != nil { return types.Paragraph{}, err } - p.Lines = lines - switch sub { - case "normal", "attributes": - if p.Lines, err = applyAttributeSubstitutionsOnLines(p.Lines, attrs); err != nil { - return types.Paragraph{}, err - } - } } + p.Lines = splitLines(elements) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("paragraph after substitution:") + // spew.Fdump(log.StandardLogger().Out, p) + // } return p, nil } -type paragraphSubstitutionFunc func(lines []interface{}, options ...Option) ([]interface{}, error) +type elementsSubstitutionFunc func(lines []interface{}, attrs types.AttributesWithOverrides, options ...Option) ([]interface{}, error) -// substitution returns the substitution func matching the given name +// paragraphSubstitutions returns the substitution funcs matching the given `subs` arg // otherwise, returns a default substitution which will ultemately fail -func substitution(name string) paragraphSubstitutionFunc { - log.Debugf("applying the '%s' paragraph substitution", name) - switch name { - case "normal": - return paragraphSubstitution("NormalParagraphContentSubstitution") - case "quotes": - return paragraphSubstitution("QuotedTextSubstitution") - case "macros": - return paragraphSubstitution("InlineMacrosSubstitution") - case "specialcharacters", "specialchars": - return paragraphSubstitution("SpecialCharactersSubstitution") - case "attributes": - return paragraphSubstitution("AttributesSubstitution") - case "replacements": - return paragraphSubstitution("ReplacementsSubstitution") - case "none": - return paragraphSubstitution("NoneSubstitution") - default: - return func(lines []interface{}, options ...Option) ([]interface{}, error) { - return nil, fmt.Errorf("unsupported substitution: '%s", name) +func paragraphSubstitutions(subs string, attrs types.AttributesWithOverrides) ([]elementsSubstitutionFunc, error) { + // log.Debugf("determining substitutions for '%s' on a paragraph", subs) + funcs := []elementsSubstitutionFunc{} + for _, s := range strings.Split(subs, ",") { + switch s { + case "specialcharacters", "specialchars": + funcs = append(funcs, substituteSpecialCharactersFunc) + case "quotes": + funcs = append(funcs, substituteQuotedTextsFunc) + case "attributes": + funcs = append(funcs, + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + ) + case "macros": + funcs = append(funcs, + substituteInlineMacrosFunc, + // resolveLocationsOnParagraphLines(attrs), + ) + case "replacements": + funcs = append(funcs, substituteReplacementsFunc) + case "post_replacements": + funcs = append(funcs, substitutePostReplacementsFunc) + case "normal": + funcs = append(funcs, + substituteInlinePassthroughFunc, + substituteSpecialCharactersFunc, + substituteQuotedTextsFunc, // done at the same time as the inline macros + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + substituteReplacementsFunc, + substituteInlineMacrosFunc, // substituteQuotedTextAndInlineMacrosFunc, + // resolveLocationsOnParagraphLines(attrs), + substitutePostReplacementsFunc, + ) + case "none": + funcs = append(funcs, substituteNothingFunc) + default: + return nil, fmt.Errorf("unsupported substitution: '%s", s) + } + } + return funcs, nil +} + +var ( + substituteInlinePassthroughFunc = elementsSubstitution("InlinePassthroughSubstitution") + substituteSpecialCharactersFunc = elementsSubstitution("SpecialCharactersSubstitution") + substituteQuotedTextsFunc = elementsSubstitutionWithPlaceholders("QuotedTextSubstitution") + substituteAttributesFunc = elementsSubstitutionWithPlaceholders("AttributesSubstitution") // TODO: include with applyAttributeSubstitutionsOnElementsFunc? + substituteReplacementsFunc = elementsSubstitutionWithPlaceholders("ReplacementsSubstitution") + substituteInlineMacrosFunc = elementsSubstitutionWithPlaceholders("InlineMacrosSubstitution") // elementsSubstitution("InlineMacrosSubstitution") + // substituteQuotedTextAndInlineMacrosFunc = elementsSubstitution("QuotedTextAndInlineMacrosSubstitution") + substitutePostReplacementsFunc = elementsSubstitutionWithPlaceholders("PostReplacementsSubstitution") + substituteNothingFunc = elementsSubstitution("NoneSubstitution") +) + +func elementsSubstitution(ruleName string) elementsSubstitutionFunc { + return func(elements []interface{}, _ types.AttributesWithOverrides, options ...Option) ([]interface{}, error) { + log.Debugf("applying the '%s' substitution on elements", ruleName) + result, err := parseElements(serializeElements(elements), append(options, Entrypoint(ruleName))...) + if err != nil { + return nil, err } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applied '%s' substitution", ruleName) + spew.Fdump(log.StandardLogger().Out, result) + } + return result, nil } } -func paragraphSubstitution(entrypoint string) paragraphSubstitutionFunc { - return func(lines []interface{}, options ...Option) ([]interface{}, error) { - elements := []interface{}{} - for _, element := range serializeParagraphLines(lines) { +func elementsSubstitutionWithPlaceholders(ruleName string) elementsSubstitutionFunc { + return func(elements []interface{}, attrs types.AttributesWithOverrides, options ...Option) ([]interface{}, error) { + log.Debugf("applying the '%s' substitution on elements (imagesdir='%v')", ruleName, attrs.GetAsStringWithDefault("imagesdir", "")) + elements, placeholders := serializeElementsWithPlaceHolders(elements) + gb := GlobalStore("imagesdir", attrs.GetAsStringWithDefault("imagesdir", "")) // TODO:define a const for "imagesdir" + options = append(options, Entrypoint(ruleName), gb) + // process placeholder content (eg: quoted text may contain an inline link) + for ref, placeholder := range placeholders { + switch placeholder := placeholder.(type) { + case types.QuotedString: + var err error + if placeholder.Elements, err = parseElements(placeholder.Elements, options...); err != nil { + return nil, err + } + placeholders[ref] = placeholder + case types.QuotedText: + var err error + if placeholder.Elements, err = parseElements(placeholder.Elements, options...); err != nil { + return nil, err + } + placeholders[ref] = placeholder + } + } + result := make([]interface{}, 0, len(elements)) + for _, element := range elements { switch element := element.(type) { case types.StringElement: // coming as-is from the Raw document - elmts, err := parseContent("", element.Content, Entrypoint(entrypoint)) + elmts, err := parseContent("", element.Content, options...) if err != nil { return nil, err } - elements = append(elements, elmts...) + elmts = restoreElements(elmts, placeholders) + result = append(result, elmts...) default: - elements = append(elements, element) + result = append(result, element) } } - result := splitLines(elements) if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("paragraph lines after substitution:") + log.Debugf("applied '%s' substitution", ruleName) spew.Fdump(log.StandardLogger().Out, result) } return result, nil } } +func parseElements(elements []interface{}, options ...Option) ([]interface{}, error) { + result := make([]interface{}, 0, len(elements)) // default capacity (but may not be enough) + for _, element := range elements { + switch element := element.(type) { + case types.StringElement: + elmts, err := parseContent("", element.Content, options...) + if err != nil { + return nil, err + } + result = append(result, elmts...) + default: + result = append(result, element) + } + } + return result, nil +} + +// replace the placeholders with their original element in the given elements +func restoreElements(elmts []interface{}, placeholders map[string]interface{}) []interface{} { + // skip if there's nothing to restore + if len(placeholders) == 0 { + return elmts + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("restoring elements on") + spew.Fdump(log.StandardLogger().Out, elmts) + } + for i, elmt := range elmts { + switch elmt := elmt.(type) { + case types.ElementPlaceHolder: + elmts[i] = placeholders[elmt.Ref] + case types.InlineLink: // TODO: use an interface and implement the `restoreElements` func on these types, instead + elmt.Location.Path = restoreElements(elmt.Location.Path, placeholders) + elmt.Attributes = restoreAttributes(elmt.Attributes, placeholders) + elmts[i] = elmt + case types.QuotedText: + elmt.Elements = restoreElements(elmt.Elements, placeholders) + elmt.Attributes = restoreAttributes(elmt.Attributes, placeholders) + elmts[i] = elmt + case types.QuotedString: + elmt.Elements = restoreElements(elmt.Elements, placeholders) + elmts[i] = elmt + case types.IndexTerm: + elmt.Term = restoreElements(elmt.Term, placeholders) + elmts[i] = elmt + case types.ExternalCrossReference: + elmt.Label = restoreElements(elmt.Label, placeholders) + elmts[i] = elmt + case types.Footnote: + elmt.Elements = restoreElements(elmt.Elements, placeholders) + elmts[i] = elmt + case types.ElementRole: + elmts[i] = types.ElementRole(restoreElements(elmt, placeholders)) + case []interface{}: + elmts[i] = restoreElements(elmt, placeholders) + default: + // do nothing, keep elmt as-is + } + } + return elmts +} + +// replace the placeholders with their original element in the given attributes +func restoreAttributes(attrs types.Attributes, placeholders map[string]interface{}) types.Attributes { + for key, value := range attrs { + switch value := value.(type) { + case types.ElementPlaceHolder: + attrs[key] = placeholders[value.Ref] + case types.ElementRole: + attrs[key] = types.ElementRole(restoreElements(value, placeholders)) + case []interface{}: + attrs[key] = restoreElements(value, placeholders) + } + } + return attrs +} + +var applyAttributeSubstitutionsOnElementsFunc = func(elements []interface{}, attrs types.AttributesWithOverrides, options ...Option) ([]interface{}, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("applying attributes substitutions") + // spew.Fdump(log.StandardLogger().Out, lines) + // } + for i, element := range elements { + element, err := applyAttributeSubstitutionsOnElement(element, attrs) + if err != nil { + return nil, err + } + elements[i] = element + } + elements = types.Merge(elements) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applied attributes substitutions") + spew.Fdump(log.StandardLogger().Out, elements) + } + return elements, nil +} + func splitLines(elements []interface{}) []interface{} { // after processing all the elements, we want to split them in separate lines again, to retain the initial input "form" lines := []interface{}{} @@ -429,12 +694,19 @@ func splitLines(elements []interface{}) []interface{} { // return elements, nil // } -func serializeParagraphLines(elements []interface{}) []interface{} { +func serializeElements(elements []interface{}) []interface{} { result := []interface{}{} for i, e := range elements { switch e := e.(type) { + case []interface{}: + result = append(result, e...) + if i < len(elements)-1 { + result = append(result, types.StringElement{ + Content: "\n", + }) + } case types.RawLine: - result = append(result, types.StringElement(e)) // converting + result = append(result, types.StringElement{Content: e.Content}) // converting if i < len(elements)-1 { result = append(result, types.StringElement{ Content: "\n", @@ -442,6 +714,24 @@ func serializeParagraphLines(elements []interface{}) []interface{} { } case types.SingleLineComment: result = append(result, e) + default: + result = append(result, e) + } + } + result = types.Merge(result) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("serialized elements:") + spew.Fdump(log.StandardLogger().Out, result) + } + return result +} + +func serializeElementsWithPlaceHolders(elements []interface{}) ([]interface{}, map[string]interface{}) { + result := []interface{}{} + seq := 0 + placeholders := map[string]interface{}{} + for i, e := range elements { + switch e := e.(type) { case []interface{}: result = append(result, e...) if i < len(elements)-1 { @@ -449,156 +739,164 @@ func serializeParagraphLines(elements []interface{}) []interface{} { Content: "\n", }) } + case types.RawLine: + result = append(result, types.StringElement{Content: e.Content}) // converting + if i < len(elements)-1 { + result = append(result, types.StringElement{ + Content: "\n", + }) + } + case types.StringElement: + result = append(result, e) + case types.SingleLineComment: + result = append(result, e) + default: + // replace with placeholder + seq++ + placeholders[strconv.Itoa(seq)] = e + ph := types.ElementPlaceHolder{ + Ref: strconv.Itoa(seq), + } + result = append(result, types.StringElement{Content: ph.String()}) } } result = types.Merge(result) if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("serialized paragraph:") + log.Debugf("serialized elements:") spew.Fdump(log.StandardLogger().Out, result) } - return result + return result, placeholders } // ---------------------------------------------------------------------------- // Attribute substitutions // ---------------------------------------------------------------------------- -// applyAttributeSubstitutions applies the document attribute substitutions -// and re-parses the content if they were affected (ie, a substitution occurred) -func applyAttributeSubstitutions(element interface{}, attrs types.AttributesWithOverrides) (interface{}, error) { - result, _, err := applyAttributeSubstitutionsOnElement(element, attrs) - return result, err - +func applyAttributeSubstitutionsOnElements(elements []interface{}, attrs types.AttributesWithOverrides) ([]interface{}, error) { + result := make([]interface{}, 0, len(elements)) // maximum capacity should exceed initial input + for _, element := range elements { + e, err := applyAttributeSubstitutionsOnElement(element, attrs) + if err != nil { + return nil, err + } + result = append(result, e) + } + result = types.Merge(result) + return result, nil } -func applyAttributeSubstitutionsOnElement(element interface{}, attrs types.AttributesWithOverrides) (interface{}, bool, error) { - log.Debugf("applying attribute substitutions on element of type '%T'", element) +func applyAttributeSubstitutionsOnElement(element interface{}, attrs types.AttributesWithOverrides) (interface{}, error) { + log.Debugf("applying attribute substitution on element of type '%T'", element) switch e := element.(type) { + case types.Paragraph: + for i, l := range e.Lines { + l, err := applyAttributeSubstitutionsOnElement(l, attrs) + if err != nil { + return nil, err + } + e.Lines[i] = l + } + return e, nil + case []interface{}: + return applyAttributeSubstitutionsOnElements(e, attrs) case types.AttributeDeclaration: attrs.Set(e.Name, e.Value) - return e, false, nil + return e, nil case types.AttributeReset: attrs.Set(e.Name, nil) // This allows us to test for a reset vs. undefined. - return e, false, nil + return e, nil case types.AttributeSubstitution: if value, ok := attrs.GetAsString(e.Name); ok { return types.StringElement{ Content: value, - }, true, nil + }, nil } log.Warnf("unable to find attribute '%s'", e.Name) return types.StringElement{ Content: "{" + e.Name + "}", - }, false, nil + }, nil case types.CounterSubstitution: return applyCounterSubstitution(e, attrs) case types.ImageBlock: - return e.ResolveLocation(attrs), false, nil + p, err := applyAttributeSubstitutionsOnElements(e.Location.Path, attrs) + if err != nil { + return nil, err + } + e.Location.Path = p + return e, nil case types.InlineImage: - return e.ResolveLocation(attrs), false, nil + p, err := applyAttributeSubstitutionsOnElements(e.Location.Path, attrs) + if err != nil { + return nil, err + } + e.Location.Path = p + return e, nil + case types.InlineLink: + p, err := applyAttributeSubstitutionsOnElements(e.Location.Path, attrs) + if err != nil { + return nil, err + } + e.Location.Path = p + return e, nil case types.ExternalCrossReference: - return e.ResolveLocation(attrs), false, nil - case types.Section: - title, _, err := applyAttributeSubstitutionsOnElements(e.Title, attrs) + p, err := applyAttributeSubstitutionsOnElements(e.Location.Path, attrs) if err != nil { - return nil, false, err + return nil, err } - e.Title = title - e, err = e.ResolveID(attrs) + e.Location.Path = p + return e, nil + case types.Section: + title, err := applyAttributeSubstitutionsOnElements(e.Title, attrs) if err != nil { - return nil, false, err + return nil, err } - return e, false, nil + e.Title = title + return e.ResolveID(attrs) case types.OrderedListItem: - elmts, _, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) + elmts, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) if err != nil { - return nil, false, err + return nil, err } e.Elements = elmts - return e, false, nil + return e, nil case types.UnorderedListItem: - elmts, _, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) + elmts, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) if err != nil { - return nil, false, err + return nil, err } e.Elements = elmts - return e, false, nil + return e, nil case types.LabeledListItem: - elmts, _, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) + elmts, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) if err != nil { - return nil, false, err + return nil, err } e.Elements = elmts - return e, false, nil + return e, nil case types.QuotedText: - elmts, _, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) + elmts, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) if err != nil { - return nil, false, err + return nil, err } e.Elements = elmts - return e, false, nil + return e, nil case types.ContinuedListItemElement: - elmt, applied, err := applyAttributeSubstitutionsOnElement(e.Element, attrs) + elmt, err := applyAttributeSubstitutionsOnElement(e.Element, attrs) if err != nil { - return nil, false, err + return nil, err } e.Element = elmt - return e, applied, nil + return e, nil case types.DelimitedBlock: - elmts, _, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) + elmts, err := applyAttributeSubstitutionsOnElements(e.Elements, attrs) if err != nil { - return nil, false, err + return nil, err } e.Elements = elmts - return e, false, nil - case types.Paragraph: - for i, l := range e.Lines { - if l, ok := l.([]interface{}); ok { - l, _, err := applyAttributeSubstitutionsOnElement(l, attrs) - if err != nil { - return nil, false, err - } - e.Lines[i] = l - } - } - return e, false, nil - case []interface{}: - return applyAttributeSubstitutionsOnElements(e, attrs) + return e, nil default: - return e, false, nil - } -} - -func applyAttributeSubstitutionsOnElements(elements []interface{}, attrs types.AttributesWithOverrides) ([]interface{}, bool, error) { - result := make([]interface{}, 0, len(elements)) // maximum capacity should exceed initial input - applied := false - for _, element := range elements { - e, a, err := applyAttributeSubstitutionsOnElement(element, attrs) - if err != nil { - return nil, false, err - } - result = append(result, e) - applied = applied || a - } - result = types.Merge(result) - if !applied { - return result, false, nil - } - result, err := parseInlineLinks(result) - return result, true, err -} - -func applyAttributeSubstitutionsOnLines(lines []interface{}, attrs types.AttributesWithOverrides) ([]interface{}, error) { - for i, line := range lines { - if line, ok := line.([]interface{}); ok { - line, _, err := applyAttributeSubstitutionsOnElements(line, attrs) - if err != nil { - return nil, err - } - lines[i] = line - } + return e, nil } - return lines, nil } // applyCounterSubstitutions is called by applyAttributeSubstitutionsOnElement. Unless there is an error with @@ -607,7 +905,7 @@ func applyAttributeSubstitutionsOnLines(lines []interface{}, attrs types.Attribu // and the error. The extra boolean here is to fit the calling expectations of our caller. This function was // factored out of a case from applyAttributeSubstitutionsOnElement in order to reduce the complexity of that // function, but otherwise it should have no callers. -func applyCounterSubstitution(c types.CounterSubstitution, attrs types.AttributesWithOverrides) (interface{}, bool, error) { +func applyCounterSubstitution(c types.CounterSubstitution, attrs types.AttributesWithOverrides) (interface{}, error) { log.Debugf("applying counter substitution for '%s'", c.Name) counter := attrs.Counters[c.Name] if counter == nil { @@ -627,11 +925,11 @@ func applyCounterSubstitution(c types.CounterSubstitution, attrs types.Attribute attrs.Counters[c.Name] = counter if c.Hidden { // return empty string facilitates merging - return types.StringElement{Content: ""}, true, nil + return types.StringElement{Content: ""}, nil } return types.StringElement{ Content: strconv.Itoa(counter), - }, true, nil + }, nil case rune: if increment { counter++ @@ -639,35 +937,85 @@ func applyCounterSubstitution(c types.CounterSubstitution, attrs types.Attribute attrs.Counters[c.Name] = counter if c.Hidden { // return empty string facilitates merging - return types.StringElement{Content: ""}, true, nil + return types.StringElement{Content: ""}, nil } return types.StringElement{ Content: string(counter), - }, true, nil + }, nil default: - return nil, false, fmt.Errorf("invalid counter type %T", counter) + return nil, fmt.Errorf("invalid counter type %T", counter) } - } -// if a document attribute substitution happened, we need to parse the string element in search -// for a potentially new link. Eg `{url}` giving `https://foo.com` -func parseInlineLinks(elements []interface{}) ([]interface{}, error) { - result := []interface{}{} - for _, element := range elements { - switch element := element.(type) { - case types.StringElement: - log.Debugf("looking for links in line element of type %[1]T (%[1]v)", element) - elements, err := ParseReader("", strings.NewReader(element.Content), Entrypoint("InlineLinks")) - if err != nil { - return []interface{}{}, errors.Wrap(err, "error while parsing content for inline links") - } - log.Debugf(" found: %+v", elements) - result = append(result, elements.([]interface{})...) - default: - result = append(result, element) - } - } - return result, nil -} +// -------------------------------------------------------- +// Locations resolution +// -------------------------------------------------------- + +// func resolveLocationsOnParagraphLines(attrs types.AttributesWithOverrides) elementsSubstitutionFunc { +// return func(lines []interface{}, _ ...Option) ([]interface{}, error) { +// for i, line := range lines { +// lines[i] = resolveLocationsOnElement(line, attrs) +// } +// return lines, nil +// } +// } + +// func resolveLocationsOnElements(elements []interface{}, attrs types.AttributesWithOverrides) []interface{} { +// for i, e := range elements { +// switch e := e.(type) { +// case []interface{}: +// elements[i] = resolveLocationsOnElements(e, attrs) +// default: +// elements[i] = resolveLocationsOnElement(e, attrs) +// } +// } +// return elements +// } + +// func resolveLocationsOnElement(element interface{}, attrs types.AttributesWithOverrides) interface{} { +// log.Debugf("resolving location on element of type '%T'", element) +// switch e := element.(type) { +// case []interface{}: +// return resolveLocationsOnElements(e, attrs) +// case types.Section: +// e.Title = resolveLocationsOnElements(e.Title, attrs) +// e.Elements = resolveLocationsOnElements(e.Elements, attrs) +// return e +// case types.QuotedText: +// e.Elements = resolveLocationsOnElements(e.Elements, attrs) +// return e +// case types.ImageBlock: // TODO: use single interface? +// return e.ResolveLocation(attrs) +// case types.InlineImage: +// return e.ResolveLocation(attrs) +// case types.InlineLink: +// return e.ResolveLocation(attrs) +// case types.ExternalCrossReference: +// return e.ResolveLocation(attrs) +// default: +// // do nothing +// return e +// } +// } + +// // if a document attribute substitution happened, we need to parse the string element in search +// // for a potentially new link. Eg `{url}` giving `https://foo.com` +// func parseInlineLinks(elements []interface{}) ([]interface{}, error) { +// result := []interface{}{} +// for _, element := range elements { +// switch element := element.(type) { +// case types.StringElement: +// log.Debugf("looking for links in line element of type %[1]T (%[1]v)", element) +// elements, err := ParseReader("", strings.NewReader(element.Content), Entrypoint("InlineLinks")) +// if err != nil { +// return []interface{}{}, errors.Wrap(err, "error while parsing content for inline links") +// } +// log.Debugf(" found: %+v", elements) +// result = append(result, elements.([]interface{})...) +// default: +// result = append(result, element) +// } +// } +// return result, nil +// } diff --git a/pkg/parser/document_processing_apply_substitutions_test.go b/pkg/parser/document_processing_apply_substitutions_test.go index 2c8c5f44..3cdbd8da 100644 --- a/pkg/parser/document_processing_apply_substitutions_test.go +++ b/pkg/parser/document_processing_apply_substitutions_test.go @@ -26,7 +26,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -64,7 +64,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -105,7 +105,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -146,7 +146,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{}, Overrides: map[string]string{}, }) @@ -186,7 +186,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{}, Overrides: map[string]string{}, }) @@ -232,7 +232,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", "scheme": "https", @@ -248,20 +248,7 @@ var _ = Describe("document attribute subsititutions", func() { Lines: []interface{}{ []interface{}{ types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.bar", - }, - }, - }, - }, - types.StringElement{ - Content: ".", + Content: "a link to https://foo.bar[].", }, }, }, @@ -291,7 +278,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -335,7 +322,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -379,7 +366,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -426,7 +413,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -482,7 +469,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -533,7 +520,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -579,7 +566,7 @@ var _ = Describe("document attribute subsititutions", func() { }, } // when - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{ "foo": "bar", }, @@ -619,7 +606,7 @@ var _ = Describe("document attribute subsititutions", func() { Name: "foo", }, } - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{}, Overrides: map[string]string{}, Counters: map[string]interface{}{}, @@ -665,7 +652,7 @@ var _ = Describe("document attribute subsititutions", func() { Name: "set", }, } - result, err := applyAttributeSubstitutions(elements, types.AttributesWithOverrides{ + result, err := applyAttributeSubstitutionsOnElement(elements, types.AttributesWithOverrides{ Content: map[string]interface{}{}, Overrides: map[string]string{}, Counters: map[string]interface{}{}, diff --git a/pkg/parser/document_processing_include_files.go b/pkg/parser/document_processing_include_files.go index 7b69147a..104dd789 100644 --- a/pkg/parser/document_processing_include_files.go +++ b/pkg/parser/document_processing_include_files.go @@ -32,6 +32,7 @@ func processFileInclusions(elements []interface{}, globalAttrs types.AttributesW result = append(result, e) case types.FileInclusion: // read the file and include its content + elements, err := parseFileToInclude(e, globalAttrs, levelOffsets, config, options...) if err != nil { return nil, err @@ -97,8 +98,35 @@ func absoluteOffset(offset int) levelOffset { } } +// applies the elements and attributes substitutions on the given image block. +func applySubstitutionsOnFileInclusion(f types.FileInclusion, attrs types.AttributesWithOverrides, options ...Option) (types.FileInclusion, error) { + elements := f.Location.Path + // apply all the "normal" subtitutions + subs := []elementsSubstitutionFunc{ + substituteAttributesFunc, // detect the replacements + applyAttributeSubstitutionsOnElementsFunc, // apply the replacements + } + var err error + for _, sub := range subs { + if elements, err = sub(elements, attrs, options...); err != nil { + return types.FileInclusion{}, err + } + } + f.Location.Path = elements + + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("FileInclusion after substitution:") + spew.Fdump(log.StandardLogger().Out, f) + } + return f, nil +} + func parseFileToInclude(incl types.FileInclusion, attrs types.AttributesWithOverrides, levelOffsets []levelOffset, config configuration.Configuration, options ...Option) ([]interface{}, error) { - path := incl.Location.Resolve(attrs).String() + incl, err := applySubstitutionsOnFileInclusion(incl, attrs) + if err != nil { + return nil, err + } + path := incl.Location.Stringify() currentDir := filepath.Dir(config.Filename) log.Debugf("parsing '%s' from current dir '%s' (%s)", path, currentDir, config.Filename) f, absPath, done, err := open(filepath.Join(currentDir, path)) diff --git a/pkg/parser/document_processing_include_files_test.go b/pkg/parser/document_processing_include_files_test.go index bad3f844..1101a61f 100644 --- a/pkg/parser/document_processing_include_files_test.go +++ b/pkg/parser/document_processing_include_files_test.go @@ -23,20 +23,6 @@ var _ = DescribeTable("'FileLocation' pattern", GinkgoT().Log("expected result: %s", spew.Sdump(expected)) Expect(actual).To(Equal(expected)) }, - Entry("'chapter'", "chapter", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "chapter", - }, - }, - }), - Entry("'chapter.adoc'", "chapter.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "chapter.adoc", - }, - }, - }), Entry("'chapter-a.adoc'", "chapter-a.adoc", types.Location{ Path: []interface{}{ types.StringElement{ @@ -58,45 +44,17 @@ var _ = DescribeTable("'FileLocation' pattern", }, }, }), - Entry("'chapter-{foo}.adoc'", "chapter-{foo}.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "chapter-", - }, - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: ".adoc", - }, - }, - }), Entry("'{includedir}/chapter-{foo}.adoc'", "{includedir}/chapter-{foo}.adoc", types.Location{ Path: []interface{}{ - types.AttributeSubstitution{ - Name: "includedir", - }, types.StringElement{ - Content: "/chapter-", - }, - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: ".adoc", + Content: "{includedir}/chapter-{foo}.adoc", // attribute substitutions are treared as part of the string element }, }, }), Entry("'{scheme}://{path}'", "{scheme}://{path}", types.Location{ Path: []interface{}{ - types.AttributeSubstitution{ - Name: "scheme", - }, - types.StringElement{ - Content: "://", - }, - types.AttributeSubstitution{ - Name: "path", + types.StringElement{ // attribute substitutions are treared as part of the string element + Content: "{scheme}://{path}", }, }, }), @@ -864,7 +822,9 @@ include::{includedir}/chapter-a.adoc[]` }, }, } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) + result, err := ParseRawDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchRawDocument(expected)) }) It("should not further process with non-asciidoc files", func() { diff --git a/pkg/parser/document_processing_test.go b/pkg/parser/document_processing_test.go index e63a7be3..1d435b16 100644 --- a/pkg/parser/document_processing_test.go +++ b/pkg/parser/document_processing_test.go @@ -246,7 +246,7 @@ eve - analyzes an image to determine if it's a picture of a life form configuration.WithAttributes(map[string]string{ types.AttrDocType: "manpage", }, - ))).To(Equal(expected)) + ))).To(MatchDocument(expected)) }) }) diff --git a/pkg/parser/element_attributes_test.go b/pkg/parser/element_attributes_test.go index 02a796e2..2ea0afd3 100644 --- a/pkg/parser/element_attributes_test.go +++ b/pkg/parser/element_attributes_test.go @@ -316,7 +316,7 @@ a paragraph` Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ - types.AttrRole: "a role", + types.AttrRole: types.ElementRole{"a role"}, }, Lines: []interface{}{ []interface{}{ @@ -338,7 +338,7 @@ a paragraph` Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ - types.AttrRole: "a role", + types.AttrRole: types.ElementRole{"a role"}, }, Lines: []interface{}{ []interface{}{ @@ -362,7 +362,7 @@ a paragraph` Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ - types.AttrRole: "a role", + types.AttrRole: types.ElementRole{"a role"}, }, Lines: []interface{}{ []interface{}{types.StringElement{ @@ -373,7 +373,9 @@ a paragraph` }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) }) It("blank lines after id, role and title attributes", func() { @@ -387,7 +389,7 @@ a paragraph` Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ - types.AttrRole: "a role", + types.AttrRole: types.ElementRole{"a role"}, types.AttrTitle: "title", types.AttrID: "ID", types.AttrCustomID: true, diff --git a/pkg/parser/generate.go b/pkg/parser/generate.go index a0f5c494..37141d76 100644 --- a/pkg/parser/generate.go +++ b/pkg/parser/generate.go @@ -1,3 +1,3 @@ package parser -//go:generate pigeon -optimize-parser -alternate-entrypoints AsciidocRawDocument,RawFile,TextDocument,DocumentRawBlock,FileLocation,IncludedFileLine,InlineLinks,LabeledListItemTerm,NormalParagraphContentSubstitution,NormalBlockContentSubstitution,VerseBlockContentSubstitution,MarkdownQuoteBlockAttribution,InlineElements,QuotedTextSubstitution,NoneSubstitution,AttributesSubstitution,ReplacementsSubstitution -o parser.go parser.peg +//go:generate pigeon -optimize-parser -alternate-entrypoints AsciidocRawDocument,RawFile,TextDocument,DocumentRawBlock,FileLocation,IncludedFileLine,InlineLinks,LabeledListItemTerm,NormalParagraphContentSubstitution,NormalBlockContentSubstitution,VerseBlockContentSubstitution,MarkdownQuoteBlockAttribution,InlineElements,QuotedTextSubstitution,NoneSubstitution,AttributesSubstitution,ReplacementsSubstitution,PostReplacementsSubstitution,QuotedTextAndInlineMacrosSubstitution,InlinePassthroughSubstitution -o parser.go parser.peg diff --git a/pkg/parser/icon_test.go b/pkg/parser/icon_test.go index 58c7fa07..6fc7f3fe 100644 --- a/pkg/parser/icon_test.go +++ b/pkg/parser/icon_test.go @@ -15,121 +15,193 @@ var _ = Describe("icons", func() { It("inline icon with empty alt only", func() { source := "icon:tip[]" - expected := []interface{}{ - types.Icon{ - Class: "tip", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "tip", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with empty alt and trailing spaces", func() { source := "icon:note[] \t\t " - expected := []interface{}{ - types.Icon{ - Class: "note", - }, - types.StringElement{ - Content: " \t\t ", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "note", + }, + types.StringElement{ + Content: " \t\t ", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with empty alt surrounded by text", func() { source := "beware icon:caution[] of tigers" - expected := []interface{}{ - types.StringElement{ - Content: "beware ", - }, - types.Icon{ - Class: "caution", - }, - types.StringElement{ - Content: " of tigers", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "beware ", + }, + types.Icon{ + Class: "caution", + }, + types.StringElement{ + Content: " of tigers", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with size alone", func() { source := "icon:caution[2x]" - expected := []interface{}{ - types.Icon{ - Class: "caution", - Attributes: types.Attributes{types.AttrIconSize: "2x"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "caution", + Attributes: types.Attributes{types.AttrIconSize: "2x"}, + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with other attribute (title)", func() { source := "icon:caution[title=\"bogus\"]" - expected := []interface{}{ - types.Icon{ - Class: "caution", - Attributes: types.Attributes{types.AttrTitle: "bogus"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "caution", + Attributes: types.Attributes{types.AttrTitle: "bogus"}, + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with anchor attribute", func() { source := "icon:caution[id=anchor]" - expected := []interface{}{ - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - types.AttrCustomID: true, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", + types.AttrCustomID: true, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with multiple other attributes", func() { source := "icon:caution[id=anchor,title=\"White Fang\"]" - expected := []interface{}{ - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - types.AttrCustomID: true, - types.AttrTitle: "White Fang", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", + types.AttrCustomID: true, + types.AttrTitle: "White Fang", + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with size and multiple other attributes", func() { source := "icon:caution[fw,id=anchor,title=\"White Fang\"]" - expected := []interface{}{ - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - types.AttrCustomID: true, - types.AttrTitle: "White Fang", - types.AttrIconSize: "fw", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", + types.AttrCustomID: true, + types.AttrTitle: "White Fang", + types.AttrIconSize: "fw", + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon with space after colon", func() { source := "here is my icon: icon:info[]" - expected := []interface{}{ - types.StringElement{ - Content: "here is my icon: ", - }, - types.Icon{ - Class: "info", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "here is my icon: ", + }, + types.Icon{ + Class: "info", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon in title works", func() { @@ -232,64 +304,96 @@ item 2:: two` It("inline icon in quoted text", func() { source := `an _italicized icon:warning[] message_` - expected := []interface{}{ - types.StringElement{ - Content: "an ", - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italicized "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "an ", + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italicized "}, + types.Icon{Class: "warning"}, + types.StringElement{Content: " message"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon in marked text", func() { source := `#marked icon:warning[] message#` - expected := []interface{}{ - types.QuotedText{ - Kind: types.Marked, - Elements: []interface{}{ - types.StringElement{Content: "marked "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{Content: "marked "}, + types.Icon{Class: "warning"}, + types.StringElement{Content: " message"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon in bold text", func() { source := `in *bold icon:warning[] message*` - expected := []interface{}{ - types.StringElement{Content: "in "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "in "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold "}, + types.Icon{Class: "warning"}, + types.StringElement{Content: " message"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline icon in monospace text", func() { source := "in `monospace icon:warning[] message`" - expected := []interface{}{ - types.StringElement{Content: "in "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "in "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "monospace "}, + types.Icon{Class: "warning"}, + types.StringElement{Content: " message"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) }) diff --git a/pkg/parser/image_test.go b/pkg/parser/image_test.go index 0693af4b..7d33aabe 100644 --- a/pkg/parser/image_test.go +++ b/pkg/parser/image_test.go @@ -8,645 +8,827 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("images", func() { +var _ = Describe("block images", func() { - Context("block images", func() { + Context("draft document", func() { - Context("inline elements", func() { - - It("with empty alt", func() { - source := "image::images/foo.png[]" - expected := types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with empty alt", func() { + source := "image::images/foo.png[]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, }, }, - } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("with empty alt and trailing spaces", func() { - source := "image::images/foo.png[] \t\t " - expected := types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with empty alt and trailing spaces", func() { + source := "image::images/foo.png[] \t\t " + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, }, }, - } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("with alt", func() { - source := `image::images/foo.png[the foo.png image]` - expected := types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt", func() { + source := `image::images/foo.png[the foo.png image]` + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, }, }, - } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("with dimensions and id link title meta", func() { - source := `[#img-foobar] + It("with dimensions and id link title meta", func() { + source := `[#img-foobar] .A title to foobar [link=http://foo.bar] image::images/foo.png[the foo.png image, 600, 400]` - expected := types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrID: "img-foobar", - types.AttrCustomID: true, - types.AttrTitle: "A title to foobar", - types.AttrInlineLink: "http://foo.bar", - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - types.AttrImageHeight: "400", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) - }) + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrID: "img-foobar", + types.AttrCustomID: true, + types.AttrTitle: "A title to foobar", + types.AttrInlineLink: "http://foo.bar", + types.AttrImageAlt: "the foo.png image", + types.AttrWidth: "600", + types.AttrImageHeight: "400", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + It("with roles", func() { + source := `[.role1.role2] +image::images/foo.png[the foo.png image, 600, 400]` + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + types.AttrWidth: "600", + types.AttrImageHeight: "400", + types.AttrRole: []interface{}{ + types.ElementRole{"role1"}, + types.ElementRole{"role2"}, + }, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) + }) - Context("final document", func() { + Context("final document", func() { - It("with empty alt", func() { - source := "image::images/foo.png[]" - expected := types.Document{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, + It("with empty alt", func() { + source := "image::images/foo.png[]" + expected := types.Document{ + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with implicit imagesdir document attribute", func() { - source := ` + It("with implicit imagesdir document attribute", func() { + source := ` :imagesdir: ./path/to/images image::foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "imagesdir": "./path/to/images", + }, + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images"}, + types.StringElement{Content: "foo.png"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with document attribute in URL", func() { - source := ` + It("with document attribute in URL", func() { + source := ` :dir: ./path/to/images image::{dir}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "dir": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "dir": "./path/to/images", + }, + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images/foo.png"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with implicit imagesdir", func() { - source := ` + It("with implicit imagesdir", func() { + source := ` :imagesdir: ./path/to/images image::foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "imagesdir": "./path/to/images", + }, + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images"}, + types.StringElement{Content: "foo.png"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with explicit duplicate imagesdir document attribute", func() { - source := ` + It("with explicit duplicate imagesdir document attribute", func() { + source := ` :imagesdir: ./path/to/images image::{imagesdir}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "imagesdir": "./path/to/images", + }, + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images"}, + types.StringElement{Content: "./path/to/images/foo.png"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("2 block images", func() { - source := `image::images/foo.png[] + It("2 block images", func() { + source := `image::images/foo.png[] image::images/bar.png[]` - expected := types.Document{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, + expected := types.Document{ + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, }, }, - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "bar", + }, + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "bar", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/bar.png"}, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("errors", func() { + + It("appending inline content", func() { + source := "a paragraph\nimage::images/foo.png[]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "a paragraph", + }, }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/bar.png"}, + []interface{}{ + types.StringElement{ + Content: "image::images/foo.png[]", }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) - Context("errors", func() { - - It("appending inline content", func() { - source := "a paragraph\nimage::images/foo.png[]" - expected := types.Paragraph{ - Lines: []interface{}{ - types.RawLine{Content: "a paragraph"}, - types.RawLine{Content: "image::images/foo.png[]"}, - }, - } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) - }) - - It("paragraph with block image with alt and dimensions", func() { - source := "a foo image::foo.png[foo image, 600, 400] bar" - expected := []interface{}{ - types.StringElement{Content: "a foo image::foo.png[foo image, 600, 400] bar"}, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + It("paragraph with block image with alt and dimensions", func() { + source := "a foo image::foo.png[foo image, 600, 400] bar" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a foo image::foo.png[foo image, 600, 400] bar"}, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) +}) - Context("inline images", func() { +var _ = Describe("inline images", func() { - Context("inline elements", func() { + Context("draft document", func() { - It("inline image with empty alt only", func() { - source := "image:images/foo.png[]" - expected := []interface{}{ - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with empty alt only", func() { + source := "image:images/foo.png[]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with empty alt and trailing spaces", func() { - source := "image:images/foo.png[] \t\t " - expected := []interface{}{ - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with empty alt and trailing spaces", func() { + source := "image:images/foo.png[] \t\t " + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, + types.StringElement{ + Content: " \t\t ", + }, }, }, }, - types.StringElement{ - Content: " \t\t ", - }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image surrounded with test", func() { - source := "a foo image:images/foo.png[] bar..." - expected := []interface{}{ - types.StringElement{ - Content: "a foo ", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("inline image surrounded with test", func() { + source := "a foo image:images/foo.png[] bar..." + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "a foo ", + }, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, + types.StringElement{ + Content: " bar\u2026\u200b", + }, }, }, }, - types.StringElement{ - Content: " bar\u2026\u200b", - }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with alt alone", func() { - source := "image:images/foo.png[the foo.png image]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt alone", func() { + source := "image:images/foo.png[the foo.png image]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with alt and width", func() { - source := "image:images/foo.png[the foo.png image, 600]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt and width", func() { + source := "image:images/foo.png[the foo.png image, 600]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + types.AttrWidth: "600", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with alt, width and height", func() { - source := "image:images/foo.png[the foo.png image, 600, 400]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - types.AttrImageHeight: "400", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt, width and height", func() { + source := "image:images/foo.png[the foo.png image, 600, 400]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + types.AttrWidth: "600", + types.AttrImageHeight: "400", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with alt, but empty width and height", func() { - source := "image:images/foo.png[the foo.png image, , ]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt, but empty width and height", func() { + source := "image:images/foo.png[the foo.png image, , ]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "the foo.png image", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with single other attribute only", func() { - source := "image:images/foo.png[id=myid]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrID: "myid", - types.AttrCustomID: true, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with single other attribute only", func() { + source := "image:images/foo.png[id=myid]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + types.AttrID: "myid", + types.AttrCustomID: true, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with multiple other attributes only", func() { - source := "image:images/foo.png[id=myid, title= mytitle, role = myrole ]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrID: "myid", - types.AttrCustomID: true, - types.AttrTitle: "mytitle", - types.AttrRole: "myrole", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with multiple other attributes only", func() { + source := "image:images/foo.png[id=myid, title= mytitle, role = myrole ]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + types.AttrID: "myid", + types.AttrCustomID: true, + types.AttrTitle: "mytitle", + types.AttrRole: types.ElementRole{"myrole"}, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image with alt, width, height and other attributes", func() { - source := "image:images/foo.png[ foo, 600, 400, id=myid, title=mytitle, role=myrole ]" - expected := []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - types.AttrWidth: "600", - types.AttrImageHeight: "400", - types.AttrID: "myid", - types.AttrCustomID: true, - types.AttrTitle: "mytitle", - types.AttrRole: "myrole", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("with alt, width, height and other attributes", func() { + source := "image:images/foo.png[ foo, 600, 400, id=myid, title=mytitle, role=myrole ]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + types.AttrWidth: "600", + types.AttrImageHeight: "400", + types.AttrID: "myid", + types.AttrCustomID: true, + types.AttrTitle: "mytitle", + types.AttrRole: types.ElementRole{"myrole"}, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image in a paragraph with space after colon", func() { - source := "this is an image: image:images/foo.png[]" - expected := []interface{}{ - types.StringElement{ - Content: "this is an image: ", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("inline image in a paragraph with space after colon", func() { + source := "this is an image: image:images/foo.png[]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "this is an image: ", + }, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("inline image in a paragraph without space separator", func() { - source := "this is an inline.image:images/foo.png[]" - expected := []interface{}{ - types.StringElement{ - Content: "this is an inline.", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + It("inline image in a paragraph without space separator", func() { + source := "this is an inline.image:images/foo.png[]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "this is an inline.", + }, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, + }, + }, + }, }, }, }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) - + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) - Context("final document", func() { - - It("inline image with empty alt only", func() { - source := "image:images/foo.png[]" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: []interface{}{ - []interface{}{ - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, + }) + + Context("final document", func() { + + It("with empty alt only", func() { + source := "image:images/foo.png[]" + expected := types.Document{ + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "images/foo.png"}, }, }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("inline image with document attribute in URL", func() { - source := ` + It("with document attribute in URL", func() { + source := ` :dir: ./path/to/images an image:{dir}/foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "dir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: []interface{}{ - []interface{}{ - types.StringElement{Content: "an "}, - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "dir": "./path/to/images", + }, + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "an "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images/foo.png"}, }, }, - types.StringElement{Content: "."}, }, + types.StringElement{Content: "."}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("inline image with implicit imagesdir document attribute", func() { - source := ` + It("with implicit imagesdir document attribute", func() { + source := ` :imagesdir: ./path/to/images an image:foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: []interface{}{ - []interface{}{ - types.StringElement{Content: "an "}, - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "imagesdir": "./path/to/images", + }, + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "an "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images"}, + types.StringElement{Content: "foo.png"}, }, }, - types.StringElement{Content: "."}, }, + types.StringElement{Content: "."}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("inline image with explicit duplicate imagesdir document attribute", func() { - source := ` + It("with explicit duplicate imagesdir document attribute", func() { + source := ` :imagesdir: ./path/to/images an image:{imagesdir}/foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: []interface{}{ - []interface{}{ - types.StringElement{Content: "an "}, - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/./path/to/images/foo.png"}, - }, + expected := types.Document{ + Attributes: types.Attributes{ + "imagesdir": "./path/to/images", + }, + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "an "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images"}, + types.StringElement{Content: "./path/to/images/foo.png"}, }, }, - types.StringElement{Content: "."}, }, + types.StringElement{Content: "."}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with document attribute in URL", func() { - source := `:path: ./path/to/images + It("with document attribute in URL", func() { + source := `:path: ./path/to/images image::{path}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "path": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, // resolved - }, + expected := types.Document{ + Attributes: types.Attributes{ + "path": "./path/to/images", + }, + Elements: []interface{}{ + types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{Content: "./path/to/images/foo.png"}, // resolved }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) - Context("errors", func() { + Context("errors", func() { - It("inline image appending inline content", func() { - source := "a paragraph\nimage::images/foo.png[]" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: []interface{}{ - []interface{}{ - types.StringElement{Content: "a paragraph"}, - }, - []interface{}{ - types.StringElement{Content: "image::images/foo.png[]"}, - }, + It("inline image appending inline content", func() { + source := "a paragraph\nimage::images/foo.png[]" + expected := types.Document{ + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph"}, + }, + []interface{}{ + types.StringElement{Content: "image::images/foo.png[]"}, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/link_test.go b/pkg/parser/link_test.go index 98b418d6..014da6df 100644 --- a/pkg/parser/link_test.go +++ b/pkg/parser/link_test.go @@ -612,7 +612,9 @@ a link to {url}` types.Paragraph{ Lines: []interface{}{ []interface{}{ - types.StringElement{Content: "a link to "}, + types.StringElement{ + Content: "a link to ", + }, types.InlineLink{ Location: types.Location{ Scheme: "https://", @@ -707,7 +709,9 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` }, }, }, - types.StringElement{Content: " and "}, + types.StringElement{ + Content: " and ", + }, types.InlineLink{ Location: types.Location{ Scheme: "https://", @@ -1123,7 +1127,13 @@ a link to {scheme}://{path} and https://foo.baz` Scheme: "", Path: []interface{}{ types.StringElement{ - Content: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,-_.%", + Content: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$", + }, + types.SpecialCharacter{ + Name: "&", + }, + types.StringElement{ + Content: ";=()*+,-_.%", }, }, }, @@ -1199,10 +1209,12 @@ a link to {scheme}:{path}[] and https://foo.baz` Elements: []interface{}{ types.Paragraph{ Lines: []interface{}{ - []interface{}{types.StringElement{Content: "a link to "}, + []interface{}{ + types.StringElement{ + Content: "a link to ", + }, types.InlineLink{ Location: types.Location{ - Scheme: "", Path: []interface{}{ types.StringElement{ Content: "{path}", @@ -1210,7 +1222,9 @@ a link to {scheme}:{path}[] and https://foo.baz` }, }, }, - types.StringElement{Content: " and "}, + types.StringElement{ + Content: " and ", + }, types.InlineLink{ Location: types.Location{ Scheme: "https://", diff --git a/pkg/parser/paragraph_test.go b/pkg/parser/paragraph_test.go index 377234d8..30dddf7f 100644 --- a/pkg/parser/paragraph_test.go +++ b/pkg/parser/paragraph_test.go @@ -106,7 +106,7 @@ baz` Attributes: types.Attributes{ types.AttrCustomID: true, types.AttrID: "anchor", - types.AttrRole: []string{"role1", "role2"}, + types.AttrRole: []interface{}{types.ElementRole{"role1"}, types.ElementRole{"role2"}}, types.AttrOptions: map[string]bool{"hardbreaks": true}, }, Lines: []interface{}{ @@ -133,7 +133,7 @@ baz` types.Paragraph{ Attributes: types.Attributes{ types.AttrOptions: map[string]bool{"hardbreaks": true}, - types.AttrRole: []string{"role1", "role2"}, + types.AttrRole: []interface{}{types.ElementRole{"role1"}, types.ElementRole{"role2"}}, }, Lines: []interface{}{ []interface{}{ @@ -358,6 +358,53 @@ another one using attribute substitution: {github-url}[]... []interface{}{ types.StringElement{Content: "a link to https://github.com[] "}, }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: https://github.com[]..."}, + }, + []interface{}{ + types.SingleLineComment{ + Content: " a single-line comment", + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + }) + + It("should apply the 'attributes,macros' substitution on multiple lines", func() { + // quoted text is not parsed but inline link macro is + s := strings.ReplaceAll(source, "$(SUBS)", "attributes,macros") + expected := types.DraftDocument{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Blocks: []interface{}{ + types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + types.BlankLine{}, + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes,macros", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a link to "}, + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + types.StringElement{Content: " "}, + }, []interface{}{ types.StringElement{Content: "another one using attribute substitution: "}, types.InlineLink{ @@ -384,7 +431,7 @@ another one using attribute substitution: {github-url}[]... Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) }) - It("should apply the specialchars substitution on multiple lines", func() { + It("should apply the 'specialchars' substitution on multiple lines", func() { // quoted text is not parsed but inline link macro is s := strings.ReplaceAll(source, "$(SUBS)", "specialchars") expected := types.DraftDocument{ @@ -744,7 +791,9 @@ And no space after [CAUTION] either.` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDraftDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDraftDocument(expected)) }) }) @@ -1224,10 +1273,20 @@ a paragraph` Context("with substitutions", func() { + // using the same input for all substitution tests + source := `:github-url: https://github.com + +[subs="$(SUBS)"] +a link to https://github.com[] +another one using attribute substitution: {github-url}[]... +// a single-line comment` + It("should apply the 'none' substitution", func() { - source := `[subs="none"] -a *link* to https://github.com[] ` + s := strings.ReplaceAll(source, "$(SUBS)", "none") expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ @@ -1235,20 +1294,66 @@ a *link* to https://github.com[] ` }, Lines: []interface{}{ []interface{}{ - types.StringElement{Content: "a *link* to https://github.com[] "}, + types.StringElement{Content: "a link to https://github.com[] "}, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes' substitution on multiple lines", func() { + // quoted text is parsed but inline link macro is not + s := strings.ReplaceAll(source, "$(SUBS)", "quotes") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "a link to https://github.com[] ", + }, + }, + []interface{}{ + types.StringElement{ + Content: "another one using attribute substitution: {github-url}[]...", + }, }, }, }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'macros' substitution", func() { + It("should apply the 'macros' substitution on multiple lines", func() { // quoted text is not parsed but inline link macro is - source := `[subs="macros"] -a *link* to https://github.com[] ` + s := strings.ReplaceAll(source, "$(SUBS)", "macros") expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ @@ -1257,7 +1362,7 @@ a *link* to https://github.com[] ` Lines: []interface{}{ []interface{}{ types.StringElement{ - Content: "a *link* to ", + Content: "a link to ", }, types.InlineLink{ Location: types.Location{ @@ -1270,22 +1375,24 @@ a *link* to https://github.com[] ` }, }, types.StringElement{ - Content: " ", + Content: " ", + }, + }, + []interface{}{ + types.StringElement{ + Content: "another one using attribute substitution: {github-url}[]...", }, }, }, }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'attributes' substitution", func() { + It("should apply the 'attributes' substitution on multiple lines", func() { // quoted text is not parsed but inline link macro is - source := `:github-url: https://github.com - -[subs="attributes"] -a *link* to {github-url} ` + s := strings.ReplaceAll(source, "$(SUBS)", "attributes") expected := types.Document{ Attributes: types.Attributes{ "github-url": "https://github.com", @@ -1297,10 +1404,34 @@ a *link* to {github-url} ` }, Lines: []interface{}{ []interface{}{ - types.StringElement{ - Content: "a *link* to ", - }, - types.InlineLink{ // converted into a link + types.StringElement{Content: "a link to https://github.com[] "}, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: https://github.com[]..."}, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'attributes,macros' substitution on multiple lines", func() { + // quoted text is not parsed but inline link macro is + s := strings.ReplaceAll(source, "$(SUBS)", "attributes,macros") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes,macros", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a link to "}, + types.InlineLink{ Location: types.Location{ Scheme: "https://", Path: []interface{}{ @@ -1310,33 +1441,92 @@ a *link* to {github-url} ` }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "here", - }, - types.SpecialCharacter{ - Name: ">", + types.StringElement{Content: " "}, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: "}, + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "github.com", + }, + }, + }, }, + types.StringElement{Content: "..."}, }, }, }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'macros' and 'quotes' substitutions", func() { + It("should apply the 'specialchars' substitution on multiple lines", func() { + // quoted text is not parsed but inline link macro is + s := strings.ReplaceAll(source, "$(SUBS)", "specialchars") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "specialchars", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a link to https://github.com[] "}, + types.SpecialCharacter{Name: "<"}, + types.StringElement{Content: "using the *inline link macro*"}, + types.SpecialCharacter{Name: ">"}, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the replacements substitution on multiple lines", func() { + // quoted text is not parsed but inline link macro is + s := strings.ReplaceAll(source, "$(SUBS)", "replacements") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "replacements", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a link to https://github.com[] "}, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: {github-url}[]\u2026\u200b"}, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes' and 'macros' substitutions", func() { // quoted text and inline link macro are both parsed - // (same as above, but with subs in reversed order) - source := `[subs="quotes,macros"] -a *link* to https://github.com[] ` - expected := types.DraftDocument{ - Blocks: []interface{}{ + s := strings.ReplaceAll(source, "$(SUBS)", "quotes,macros") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "quotes,macros", @@ -1344,18 +1534,60 @@ a *link* to https://github.com[] ` Lines: []interface{}{ []interface{}{ types.StringElement{ - Content: "a ", + Content: "a link to ", + }, + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + types.StringElement{ + Content: " ", + }, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'macros' and 'quotes' substitutions", func() { + // quoted text and inline link macro are both parsed + // (same as above, but with subs in reversed order) + s := strings.ReplaceAll(source, "$(SUBS)", "macros,quotes") + expected := types.Document{ + Attributes: types.Attributes{ + "github-url": "https://github.com", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros,quotes", + }, + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "a link to ", }, types.InlineLink{ Location: types.Location{ @@ -1368,14 +1600,28 @@ a *link* to https://github.com[] ` }, }, types.StringElement{ - Content: " ", + Content: " ", + }, + }, + []interface{}{ + types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 43bed794..7cff5d46 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -1856,37 +1856,37 @@ var g = &grammar{ }, { name: "InlineElementID", - pos: position{line: 260, col: 1, offset: 8194}, + pos: position{line: 260, col: 1, offset: 8185}, expr: &actionExpr{ - pos: position{line: 260, col: 20, offset: 8213}, + pos: position{line: 260, col: 20, offset: 8204}, run: (*parser).callonInlineElementID1, expr: &seqExpr{ - pos: position{line: 260, col: 20, offset: 8213}, + pos: position{line: 260, col: 20, offset: 8204}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 260, col: 20, offset: 8213}, + pos: position{line: 260, col: 20, offset: 8204}, val: "[[", ignoreCase: false, want: "\"[[\"", }, &labeledExpr{ - pos: position{line: 260, col: 25, offset: 8218}, + pos: position{line: 260, col: 25, offset: 8209}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 260, col: 29, offset: 8222}, + pos: position{line: 260, col: 29, offset: 8213}, name: "ID", }, }, &litMatcher{ - pos: position{line: 260, col: 33, offset: 8226}, + pos: position{line: 260, col: 33, offset: 8217}, val: "]]", ignoreCase: false, want: "\"]]\"", }, &zeroOrMoreExpr{ - pos: position{line: 260, col: 38, offset: 8231}, + pos: position{line: 260, col: 38, offset: 8222}, expr: &ruleRefExpr{ - pos: position{line: 260, col: 38, offset: 8231}, + pos: position{line: 260, col: 38, offset: 8222}, name: "Space", }, }, @@ -1896,36 +1896,36 @@ var g = &grammar{ }, { name: "ElementTitle", - pos: position{line: 266, col: 1, offset: 8508}, + pos: position{line: 266, col: 1, offset: 8499}, expr: &actionExpr{ - pos: position{line: 266, col: 17, offset: 8524}, + pos: position{line: 266, col: 17, offset: 8515}, run: (*parser).callonElementTitle1, expr: &seqExpr{ - pos: position{line: 266, col: 17, offset: 8524}, + pos: position{line: 266, col: 17, offset: 8515}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 266, col: 17, offset: 8524}, + pos: position{line: 266, col: 17, offset: 8515}, val: ".", ignoreCase: false, want: "\".\"", }, &labeledExpr{ - pos: position{line: 266, col: 21, offset: 8528}, + pos: position{line: 266, col: 21, offset: 8519}, label: "title", expr: &ruleRefExpr{ - pos: position{line: 266, col: 28, offset: 8535}, + pos: position{line: 266, col: 28, offset: 8526}, name: "ElementTitleContent", }, }, &zeroOrMoreExpr{ - pos: position{line: 266, col: 49, offset: 8556}, + pos: position{line: 266, col: 49, offset: 8547}, expr: &ruleRefExpr{ - pos: position{line: 266, col: 49, offset: 8556}, + pos: position{line: 266, col: 49, offset: 8547}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 266, col: 56, offset: 8563}, + pos: position{line: 266, col: 56, offset: 8554}, name: "EOL", }, }, @@ -1934,15 +1934,15 @@ var g = &grammar{ }, { name: "ElementTitleContent", - pos: position{line: 270, col: 1, offset: 8621}, + pos: position{line: 270, col: 1, offset: 8612}, expr: &actionExpr{ - pos: position{line: 270, col: 24, offset: 8644}, + pos: position{line: 270, col: 24, offset: 8635}, run: (*parser).callonElementTitleContent1, expr: &seqExpr{ - pos: position{line: 270, col: 24, offset: 8644}, + pos: position{line: 270, col: 24, offset: 8635}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 270, col: 24, offset: 8644}, + pos: position{line: 270, col: 24, offset: 8635}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -1950,9 +1950,9 @@ var g = &grammar{ inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 270, col: 32, offset: 8652}, + pos: position{line: 270, col: 32, offset: 8643}, expr: &charClassMatcher{ - pos: position{line: 270, col: 32, offset: 8652}, + pos: position{line: 270, col: 32, offset: 8643}, val: "[^\\r\\n<>]", chars: []rune{'\r', '\n', '<', '>'}, ignoreCase: false, @@ -1965,36 +1965,36 @@ var g = &grammar{ }, { name: "ElementShortHandAttributes", - pos: position{line: 276, col: 1, offset: 8906}, + pos: position{line: 276, col: 1, offset: 8897}, expr: &actionExpr{ - pos: position{line: 276, col: 31, offset: 8936}, + pos: position{line: 276, col: 31, offset: 8927}, run: (*parser).callonElementShortHandAttributes1, expr: &seqExpr{ - pos: position{line: 276, col: 31, offset: 8936}, + pos: position{line: 276, col: 31, offset: 8927}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 276, col: 31, offset: 8936}, + pos: position{line: 276, col: 31, offset: 8927}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 276, col: 35, offset: 8940}, + pos: position{line: 276, col: 35, offset: 8931}, label: "attrs", expr: &seqExpr{ - pos: position{line: 276, col: 42, offset: 8947}, + pos: position{line: 276, col: 42, offset: 8938}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 276, col: 42, offset: 8947}, + pos: position{line: 276, col: 42, offset: 8938}, expr: &ruleRefExpr{ - pos: position{line: 276, col: 42, offset: 8947}, + pos: position{line: 276, col: 42, offset: 8938}, name: "ShortHandAttr", }, }, &zeroOrMoreExpr{ - pos: position{line: 276, col: 57, offset: 8962}, + pos: position{line: 276, col: 57, offset: 8953}, expr: &ruleRefExpr{ - pos: position{line: 276, col: 57, offset: 8962}, + pos: position{line: 276, col: 57, offset: 8953}, name: "NamedAttr", }, }, @@ -2002,20 +2002,20 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 276, col: 69, offset: 8974}, + pos: position{line: 276, col: 69, offset: 8965}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 276, col: 73, offset: 8978}, + pos: position{line: 276, col: 73, offset: 8969}, expr: &ruleRefExpr{ - pos: position{line: 276, col: 73, offset: 8978}, + pos: position{line: 276, col: 73, offset: 8969}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 276, col: 80, offset: 8985}, + pos: position{line: 276, col: 80, offset: 8976}, name: "EOL", }, }, @@ -2024,20 +2024,20 @@ var g = &grammar{ }, { name: "BlockAttrs", - pos: position{line: 280, col: 1, offset: 9039}, + pos: position{line: 280, col: 1, offset: 9030}, expr: &choiceExpr{ - pos: position{line: 280, col: 15, offset: 9053}, + pos: position{line: 280, col: 15, offset: 9044}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 280, col: 15, offset: 9053}, + pos: position{line: 280, col: 15, offset: 9044}, name: "BlockAttrList", }, &ruleRefExpr{ - pos: position{line: 280, col: 31, offset: 9069}, + pos: position{line: 280, col: 31, offset: 9060}, name: "ElementTitle", }, &ruleRefExpr{ - pos: position{line: 280, col: 46, offset: 9084}, + pos: position{line: 280, col: 46, offset: 9075}, name: "ElementID", }, }, @@ -2045,57 +2045,57 @@ var g = &grammar{ }, { name: "BlockAttrList", - pos: position{line: 284, col: 1, offset: 9312}, + pos: position{line: 284, col: 1, offset: 9303}, expr: &actionExpr{ - pos: position{line: 284, col: 18, offset: 9329}, + pos: position{line: 284, col: 18, offset: 9320}, run: (*parser).callonBlockAttrList1, expr: &seqExpr{ - pos: position{line: 284, col: 18, offset: 9329}, + pos: position{line: 284, col: 18, offset: 9320}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 284, col: 18, offset: 9329}, + pos: position{line: 284, col: 18, offset: 9320}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 284, col: 22, offset: 9333}, + pos: position{line: 284, col: 22, offset: 9324}, label: "attrs", expr: &seqExpr{ - pos: position{line: 284, col: 29, offset: 9340}, + pos: position{line: 284, col: 29, offset: 9331}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 284, col: 29, offset: 9340}, + pos: position{line: 284, col: 29, offset: 9331}, expr: &ruleRefExpr{ - pos: position{line: 284, col: 29, offset: 9340}, + pos: position{line: 284, col: 29, offset: 9331}, name: "BlockAttrStyle", }, }, &zeroOrMoreExpr{ - pos: position{line: 284, col: 45, offset: 9356}, + pos: position{line: 284, col: 45, offset: 9347}, expr: &ruleRefExpr{ - pos: position{line: 284, col: 45, offset: 9356}, + pos: position{line: 284, col: 45, offset: 9347}, name: "ShortHandAttr", }, }, &zeroOrOneExpr{ - pos: position{line: 284, col: 60, offset: 9371}, + pos: position{line: 284, col: 60, offset: 9362}, expr: &ruleRefExpr{ - pos: position{line: 284, col: 60, offset: 9371}, + pos: position{line: 284, col: 60, offset: 9362}, name: "BlockAttrPositional2", }, }, &zeroOrOneExpr{ - pos: position{line: 284, col: 82, offset: 9393}, + pos: position{line: 284, col: 82, offset: 9384}, expr: &ruleRefExpr{ - pos: position{line: 284, col: 82, offset: 9393}, + pos: position{line: 284, col: 82, offset: 9384}, name: "BlockAttrPositional3", }, }, &zeroOrMoreExpr{ - pos: position{line: 284, col: 104, offset: 9415}, + pos: position{line: 284, col: 104, offset: 9406}, expr: &ruleRefExpr{ - pos: position{line: 284, col: 104, offset: 9415}, + pos: position{line: 284, col: 104, offset: 9406}, name: "NamedAttr", }, }, @@ -2103,13 +2103,13 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 284, col: 116, offset: 9427}, + pos: position{line: 284, col: 116, offset: 9418}, val: "]", ignoreCase: false, want: "\"]\"", }, &ruleRefExpr{ - pos: position{line: 284, col: 120, offset: 9431}, + pos: position{line: 284, col: 120, offset: 9422}, name: "EOL", }, }, @@ -2118,15 +2118,15 @@ var g = &grammar{ }, { name: "BlockAttrStyle", - pos: position{line: 288, col: 1, offset: 9485}, + pos: position{line: 288, col: 1, offset: 9476}, expr: &actionExpr{ - pos: position{line: 288, col: 19, offset: 9503}, + pos: position{line: 288, col: 19, offset: 9494}, run: (*parser).callonBlockAttrStyle1, expr: &labeledExpr{ - pos: position{line: 288, col: 19, offset: 9503}, + pos: position{line: 288, col: 19, offset: 9494}, label: "style", expr: &ruleRefExpr{ - pos: position{line: 288, col: 25, offset: 9509}, + pos: position{line: 288, col: 25, offset: 9500}, name: "PositionalValue", }, }, @@ -2134,40 +2134,40 @@ var g = &grammar{ }, { name: "BlockAttrPositional2", - pos: position{line: 292, col: 1, offset: 9579}, + pos: position{line: 292, col: 1, offset: 9561}, expr: &actionExpr{ - pos: position{line: 292, col: 25, offset: 9603}, + pos: position{line: 292, col: 25, offset: 9585}, run: (*parser).callonBlockAttrPositional21, expr: &seqExpr{ - pos: position{line: 292, col: 25, offset: 9603}, + pos: position{line: 292, col: 25, offset: 9585}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 292, col: 25, offset: 9603}, + pos: position{line: 292, col: 25, offset: 9585}, expr: &ruleRefExpr{ - pos: position{line: 292, col: 25, offset: 9603}, + pos: position{line: 292, col: 25, offset: 9585}, name: "Space", }, }, &litMatcher{ - pos: position{line: 292, col: 32, offset: 9610}, + pos: position{line: 292, col: 32, offset: 9592}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 292, col: 36, offset: 9614}, + pos: position{line: 292, col: 36, offset: 9596}, expr: &ruleRefExpr{ - pos: position{line: 292, col: 36, offset: 9614}, + pos: position{line: 292, col: 36, offset: 9596}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 292, col: 43, offset: 9621}, + pos: position{line: 292, col: 43, offset: 9603}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 292, col: 49, offset: 9627}, + pos: position{line: 292, col: 49, offset: 9609}, expr: &ruleRefExpr{ - pos: position{line: 292, col: 49, offset: 9627}, + pos: position{line: 292, col: 49, offset: 9609}, name: "PositionalValue", }, }, @@ -2178,40 +2178,40 @@ var g = &grammar{ }, { name: "BlockAttrPositional3", - pos: position{line: 299, col: 1, offset: 9777}, + pos: position{line: 299, col: 1, offset: 9750}, expr: &actionExpr{ - pos: position{line: 299, col: 25, offset: 9801}, + pos: position{line: 299, col: 25, offset: 9774}, run: (*parser).callonBlockAttrPositional31, expr: &seqExpr{ - pos: position{line: 299, col: 25, offset: 9801}, + pos: position{line: 299, col: 25, offset: 9774}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 299, col: 25, offset: 9801}, + pos: position{line: 299, col: 25, offset: 9774}, expr: &ruleRefExpr{ - pos: position{line: 299, col: 25, offset: 9801}, + pos: position{line: 299, col: 25, offset: 9774}, name: "Space", }, }, &litMatcher{ - pos: position{line: 299, col: 32, offset: 9808}, + pos: position{line: 299, col: 32, offset: 9781}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 299, col: 36, offset: 9812}, + pos: position{line: 299, col: 36, offset: 9785}, expr: &ruleRefExpr{ - pos: position{line: 299, col: 36, offset: 9812}, + pos: position{line: 299, col: 36, offset: 9785}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 299, col: 43, offset: 9819}, + pos: position{line: 299, col: 43, offset: 9792}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 299, col: 49, offset: 9825}, + pos: position{line: 299, col: 49, offset: 9798}, expr: &ruleRefExpr{ - pos: position{line: 299, col: 49, offset: 9825}, + pos: position{line: 299, col: 49, offset: 9798}, name: "PositionalValue", }, }, @@ -2222,28 +2222,28 @@ var g = &grammar{ }, { name: "LiteralAttribute", - pos: position{line: 306, col: 1, offset: 9975}, + pos: position{line: 306, col: 1, offset: 9939}, expr: &actionExpr{ - pos: position{line: 306, col: 21, offset: 9995}, + pos: position{line: 306, col: 21, offset: 9959}, run: (*parser).callonLiteralAttribute1, expr: &seqExpr{ - pos: position{line: 306, col: 21, offset: 9995}, + pos: position{line: 306, col: 21, offset: 9959}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 306, col: 21, offset: 9995}, + pos: position{line: 306, col: 21, offset: 9959}, val: "[literal]", ignoreCase: false, want: "\"[literal]\"", }, &zeroOrMoreExpr{ - pos: position{line: 306, col: 33, offset: 10007}, + pos: position{line: 306, col: 33, offset: 9971}, expr: &ruleRefExpr{ - pos: position{line: 306, col: 33, offset: 10007}, + pos: position{line: 306, col: 33, offset: 9971}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 306, col: 40, offset: 10014}, + pos: position{line: 306, col: 40, offset: 9978}, name: "Newline", }, }, @@ -2252,28 +2252,28 @@ var g = &grammar{ }, { name: "PassthroughBlockAttribute", - pos: position{line: 310, col: 1, offset: 10066}, + pos: position{line: 310, col: 1, offset: 10030}, expr: &actionExpr{ - pos: position{line: 310, col: 30, offset: 10095}, + pos: position{line: 310, col: 30, offset: 10059}, run: (*parser).callonPassthroughBlockAttribute1, expr: &seqExpr{ - pos: position{line: 310, col: 30, offset: 10095}, + pos: position{line: 310, col: 30, offset: 10059}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 310, col: 30, offset: 10095}, + pos: position{line: 310, col: 30, offset: 10059}, val: "[pass]", ignoreCase: false, want: "\"[pass]\"", }, &zeroOrMoreExpr{ - pos: position{line: 310, col: 39, offset: 10104}, + pos: position{line: 310, col: 39, offset: 10068}, expr: &ruleRefExpr{ - pos: position{line: 310, col: 39, offset: 10104}, + pos: position{line: 310, col: 39, offset: 10068}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 310, col: 46, offset: 10111}, + pos: position{line: 310, col: 46, offset: 10075}, name: "Newline", }, }, @@ -2282,42 +2282,42 @@ var g = &grammar{ }, { name: "AdmonitionMarkerAttribute", - pos: position{line: 315, col: 1, offset: 10252}, + pos: position{line: 315, col: 1, offset: 10216}, expr: &actionExpr{ - pos: position{line: 315, col: 30, offset: 10281}, + pos: position{line: 315, col: 30, offset: 10245}, run: (*parser).callonAdmonitionMarkerAttribute1, expr: &seqExpr{ - pos: position{line: 315, col: 30, offset: 10281}, + pos: position{line: 315, col: 30, offset: 10245}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 315, col: 30, offset: 10281}, + pos: position{line: 315, col: 30, offset: 10245}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 315, col: 34, offset: 10285}, + pos: position{line: 315, col: 34, offset: 10249}, label: "k", expr: &ruleRefExpr{ - pos: position{line: 315, col: 37, offset: 10288}, + pos: position{line: 315, col: 37, offset: 10252}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 315, col: 53, offset: 10304}, + pos: position{line: 315, col: 53, offset: 10268}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 315, col: 57, offset: 10308}, + pos: position{line: 315, col: 57, offset: 10272}, expr: &ruleRefExpr{ - pos: position{line: 315, col: 57, offset: 10308}, + pos: position{line: 315, col: 57, offset: 10272}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 315, col: 64, offset: 10315}, + pos: position{line: 315, col: 64, offset: 10279}, name: "EOL", }, }, @@ -2326,43 +2326,43 @@ var g = &grammar{ }, { name: "SourceAttributes", - pos: position{line: 320, col: 1, offset: 10470}, + pos: position{line: 320, col: 1, offset: 10434}, expr: &actionExpr{ - pos: position{line: 320, col: 21, offset: 10490}, + pos: position{line: 320, col: 21, offset: 10454}, run: (*parser).callonSourceAttributes1, expr: &seqExpr{ - pos: position{line: 320, col: 21, offset: 10490}, + pos: position{line: 320, col: 21, offset: 10454}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 320, col: 21, offset: 10490}, + pos: position{line: 320, col: 21, offset: 10454}, val: "[source", ignoreCase: false, want: "\"[source\"", }, &labeledExpr{ - pos: position{line: 321, col: 5, offset: 10505}, + pos: position{line: 321, col: 5, offset: 10469}, label: "language", expr: &zeroOrOneExpr{ - pos: position{line: 321, col: 14, offset: 10514}, + pos: position{line: 321, col: 14, offset: 10478}, expr: &actionExpr{ - pos: position{line: 321, col: 15, offset: 10515}, + pos: position{line: 321, col: 15, offset: 10479}, run: (*parser).callonSourceAttributes6, expr: &seqExpr{ - pos: position{line: 321, col: 15, offset: 10515}, + pos: position{line: 321, col: 15, offset: 10479}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 321, col: 15, offset: 10515}, + pos: position{line: 321, col: 15, offset: 10479}, val: ",", ignoreCase: false, want: "\",\"", }, &labeledExpr{ - pos: position{line: 321, col: 19, offset: 10519}, + pos: position{line: 321, col: 19, offset: 10483}, label: "attr", expr: &zeroOrOneExpr{ - pos: position{line: 321, col: 24, offset: 10524}, + pos: position{line: 321, col: 24, offset: 10488}, expr: &ruleRefExpr{ - pos: position{line: 321, col: 25, offset: 10525}, + pos: position{line: 321, col: 25, offset: 10489}, name: "StandaloneAttributeValue", }, }, @@ -2373,29 +2373,29 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 322, col: 5, offset: 10580}, + pos: position{line: 322, col: 5, offset: 10544}, label: "others", expr: &zeroOrMoreExpr{ - pos: position{line: 322, col: 12, offset: 10587}, + pos: position{line: 322, col: 12, offset: 10551}, expr: &actionExpr{ - pos: position{line: 322, col: 13, offset: 10588}, + pos: position{line: 322, col: 13, offset: 10552}, run: (*parser).callonSourceAttributes14, expr: &seqExpr{ - pos: position{line: 322, col: 13, offset: 10588}, + pos: position{line: 322, col: 13, offset: 10552}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 322, col: 13, offset: 10588}, + pos: position{line: 322, col: 13, offset: 10552}, val: ",", ignoreCase: false, want: "\",\"", }, &labeledExpr{ - pos: position{line: 322, col: 17, offset: 10592}, + pos: position{line: 322, col: 17, offset: 10556}, label: "attr", expr: &zeroOrOneExpr{ - pos: position{line: 322, col: 22, offset: 10597}, + pos: position{line: 322, col: 22, offset: 10561}, expr: &ruleRefExpr{ - pos: position{line: 322, col: 23, offset: 10598}, + pos: position{line: 322, col: 23, offset: 10562}, name: "GenericAttribute", }, }, @@ -2406,20 +2406,20 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 323, col: 5, offset: 10645}, + pos: position{line: 323, col: 5, offset: 10609}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 323, col: 9, offset: 10649}, + pos: position{line: 323, col: 9, offset: 10613}, expr: &ruleRefExpr{ - pos: position{line: 323, col: 9, offset: 10649}, + pos: position{line: 323, col: 9, offset: 10613}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 323, col: 16, offset: 10656}, + pos: position{line: 323, col: 16, offset: 10620}, name: "EOL", }, }, @@ -2428,45 +2428,45 @@ var g = &grammar{ }, { name: "AttributeGroup", - pos: position{line: 328, col: 1, offset: 10807}, + pos: position{line: 328, col: 1, offset: 10771}, expr: &actionExpr{ - pos: position{line: 328, col: 19, offset: 10825}, + pos: position{line: 328, col: 19, offset: 10789}, run: (*parser).callonAttributeGroup1, expr: &seqExpr{ - pos: position{line: 328, col: 19, offset: 10825}, + pos: position{line: 328, col: 19, offset: 10789}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 328, col: 19, offset: 10825}, + pos: position{line: 328, col: 19, offset: 10789}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 328, col: 23, offset: 10829}, + pos: position{line: 328, col: 23, offset: 10793}, label: "attributes", expr: &zeroOrMoreExpr{ - pos: position{line: 328, col: 34, offset: 10840}, + pos: position{line: 328, col: 34, offset: 10804}, expr: &ruleRefExpr{ - pos: position{line: 328, col: 35, offset: 10841}, + pos: position{line: 328, col: 35, offset: 10805}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 328, col: 54, offset: 10860}, + pos: position{line: 328, col: 54, offset: 10824}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 328, col: 58, offset: 10864}, + pos: position{line: 328, col: 58, offset: 10828}, expr: &ruleRefExpr{ - pos: position{line: 328, col: 58, offset: 10864}, + pos: position{line: 328, col: 58, offset: 10828}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 328, col: 65, offset: 10871}, + pos: position{line: 328, col: 65, offset: 10835}, name: "EOL", }, }, @@ -2475,16 +2475,16 @@ var g = &grammar{ }, { name: "GenericAttribute", - pos: position{line: 332, col: 1, offset: 10943}, + pos: position{line: 332, col: 1, offset: 10907}, expr: &choiceExpr{ - pos: position{line: 332, col: 21, offset: 10963}, + pos: position{line: 332, col: 21, offset: 10927}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 332, col: 21, offset: 10963}, + pos: position{line: 332, col: 21, offset: 10927}, name: "GenericAttributeWithValue", }, &ruleRefExpr{ - pos: position{line: 332, col: 49, offset: 10991}, + pos: position{line: 332, col: 49, offset: 10955}, name: "GenericAttributeWithoutValue", }, }, @@ -2492,51 +2492,51 @@ var g = &grammar{ }, { name: "GenericAttributeWithValue", - pos: position{line: 334, col: 1, offset: 11021}, + pos: position{line: 334, col: 1, offset: 10985}, expr: &actionExpr{ - pos: position{line: 334, col: 30, offset: 11050}, + pos: position{line: 334, col: 30, offset: 11014}, run: (*parser).callonGenericAttributeWithValue1, expr: &seqExpr{ - pos: position{line: 334, col: 30, offset: 11050}, + pos: position{line: 334, col: 30, offset: 11014}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 334, col: 30, offset: 11050}, + pos: position{line: 334, col: 30, offset: 11014}, label: "key", expr: &ruleRefExpr{ - pos: position{line: 334, col: 35, offset: 11055}, + pos: position{line: 334, col: 35, offset: 11019}, name: "AttributeKey", }, }, &litMatcher{ - pos: position{line: 334, col: 49, offset: 11069}, + pos: position{line: 334, col: 49, offset: 11033}, val: "=", ignoreCase: false, want: "\"=\"", }, &labeledExpr{ - pos: position{line: 334, col: 53, offset: 11073}, + pos: position{line: 334, col: 53, offset: 11037}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 334, col: 59, offset: 11079}, + pos: position{line: 334, col: 59, offset: 11043}, expr: &ruleRefExpr{ - pos: position{line: 334, col: 60, offset: 11080}, + pos: position{line: 334, col: 60, offset: 11044}, name: "AttributeValue", }, }, }, &zeroOrOneExpr{ - pos: position{line: 334, col: 77, offset: 11097}, + pos: position{line: 334, col: 77, offset: 11061}, expr: &litMatcher{ - pos: position{line: 334, col: 77, offset: 11097}, + pos: position{line: 334, col: 77, offset: 11061}, val: ",", ignoreCase: false, want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 334, col: 82, offset: 11102}, + pos: position{line: 334, col: 82, offset: 11066}, expr: &ruleRefExpr{ - pos: position{line: 334, col: 82, offset: 11102}, + pos: position{line: 334, col: 82, offset: 11066}, name: "Space", }, }, @@ -2546,34 +2546,34 @@ var g = &grammar{ }, { name: "GenericAttributeWithoutValue", - pos: position{line: 338, col: 1, offset: 11201}, + pos: position{line: 338, col: 1, offset: 11165}, expr: &actionExpr{ - pos: position{line: 338, col: 33, offset: 11233}, + pos: position{line: 338, col: 33, offset: 11197}, run: (*parser).callonGenericAttributeWithoutValue1, expr: &seqExpr{ - pos: position{line: 338, col: 33, offset: 11233}, + pos: position{line: 338, col: 33, offset: 11197}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 338, col: 33, offset: 11233}, + pos: position{line: 338, col: 33, offset: 11197}, label: "key", expr: &ruleRefExpr{ - pos: position{line: 338, col: 38, offset: 11238}, + pos: position{line: 338, col: 38, offset: 11202}, name: "AttributeKey", }, }, &zeroOrOneExpr{ - pos: position{line: 338, col: 52, offset: 11252}, + pos: position{line: 338, col: 52, offset: 11216}, expr: &litMatcher{ - pos: position{line: 338, col: 52, offset: 11252}, + pos: position{line: 338, col: 52, offset: 11216}, val: ",", ignoreCase: false, want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 338, col: 57, offset: 11257}, + pos: position{line: 338, col: 57, offset: 11221}, expr: &ruleRefExpr{ - pos: position{line: 338, col: 57, offset: 11257}, + pos: position{line: 338, col: 57, offset: 11221}, name: "Space", }, }, @@ -2583,57 +2583,57 @@ var g = &grammar{ }, { name: "AttributeKey", - pos: position{line: 342, col: 1, offset: 11345}, + pos: position{line: 342, col: 1, offset: 11309}, expr: &actionExpr{ - pos: position{line: 342, col: 17, offset: 11361}, + pos: position{line: 342, col: 17, offset: 11325}, run: (*parser).callonAttributeKey1, expr: &seqExpr{ - pos: position{line: 342, col: 17, offset: 11361}, + pos: position{line: 342, col: 17, offset: 11325}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 342, col: 17, offset: 11361}, + pos: position{line: 342, col: 17, offset: 11325}, expr: &litMatcher{ - pos: position{line: 342, col: 18, offset: 11362}, + pos: position{line: 342, col: 18, offset: 11326}, val: "quote", ignoreCase: false, want: "\"quote\"", }, }, ¬Expr{ - pos: position{line: 342, col: 26, offset: 11370}, + pos: position{line: 342, col: 26, offset: 11334}, expr: &litMatcher{ - pos: position{line: 342, col: 27, offset: 11371}, + pos: position{line: 342, col: 27, offset: 11335}, val: "verse", ignoreCase: false, want: "\"verse\"", }, }, ¬Expr{ - pos: position{line: 342, col: 35, offset: 11379}, + pos: position{line: 342, col: 35, offset: 11343}, expr: &litMatcher{ - pos: position{line: 342, col: 36, offset: 11380}, + pos: position{line: 342, col: 36, offset: 11344}, val: "literal", ignoreCase: false, want: "\"literal\"", }, }, ¬Expr{ - pos: position{line: 342, col: 46, offset: 11390}, + pos: position{line: 342, col: 46, offset: 11354}, expr: &oneOrMoreExpr{ - pos: position{line: 342, col: 48, offset: 11392}, + pos: position{line: 342, col: 48, offset: 11356}, expr: &ruleRefExpr{ - pos: position{line: 342, col: 48, offset: 11392}, + pos: position{line: 342, col: 48, offset: 11356}, name: "Space", }, }, }, &labeledExpr{ - pos: position{line: 342, col: 56, offset: 11400}, + pos: position{line: 342, col: 56, offset: 11364}, label: "key", expr: &oneOrMoreExpr{ - pos: position{line: 342, col: 61, offset: 11405}, + pos: position{line: 342, col: 61, offset: 11369}, expr: &charClassMatcher{ - pos: position{line: 342, col: 61, offset: 11405}, + pos: position{line: 342, col: 61, offset: 11369}, val: "[^\\r\\n=,\\]]", chars: []rune{'\r', '\n', '=', ',', ']'}, ignoreCase: false, @@ -2642,9 +2642,9 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 342, col: 75, offset: 11419}, + pos: position{line: 342, col: 75, offset: 11383}, expr: &ruleRefExpr{ - pos: position{line: 342, col: 75, offset: 11419}, + pos: position{line: 342, col: 75, offset: 11383}, name: "Space", }, }, @@ -2654,17 +2654,17 @@ var g = &grammar{ }, { name: "AttributeValue", - pos: position{line: 346, col: 1, offset: 11462}, + pos: position{line: 346, col: 1, offset: 11426}, expr: &actionExpr{ - pos: position{line: 346, col: 19, offset: 11480}, + pos: position{line: 346, col: 19, offset: 11444}, run: (*parser).callonAttributeValue1, expr: &labeledExpr{ - pos: position{line: 346, col: 19, offset: 11480}, + pos: position{line: 346, col: 19, offset: 11444}, label: "value", expr: &oneOrMoreExpr{ - pos: position{line: 346, col: 26, offset: 11487}, + pos: position{line: 346, col: 26, offset: 11451}, expr: &charClassMatcher{ - pos: position{line: 346, col: 26, offset: 11487}, + pos: position{line: 346, col: 26, offset: 11451}, val: "[^\\r\\n=,\\]]", chars: []rune{'\r', '\n', '=', ',', ']'}, ignoreCase: false, @@ -2676,20 +2676,20 @@ var g = &grammar{ }, { name: "StandaloneAttributeValue", - pos: position{line: 350, col: 1, offset: 11538}, + pos: position{line: 350, col: 1, offset: 11502}, expr: &actionExpr{ - pos: position{line: 350, col: 29, offset: 11566}, + pos: position{line: 350, col: 29, offset: 11530}, run: (*parser).callonStandaloneAttributeValue1, expr: &seqExpr{ - pos: position{line: 350, col: 29, offset: 11566}, + pos: position{line: 350, col: 29, offset: 11530}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 350, col: 29, offset: 11566}, + pos: position{line: 350, col: 29, offset: 11530}, label: "value", expr: &oneOrMoreExpr{ - pos: position{line: 350, col: 36, offset: 11573}, + pos: position{line: 350, col: 36, offset: 11537}, expr: &charClassMatcher{ - pos: position{line: 350, col: 36, offset: 11573}, + pos: position{line: 350, col: 36, offset: 11537}, val: "[^\\r\\n=,\\]]", chars: []rune{'\r', '\n', '=', ',', ']'}, ignoreCase: false, @@ -2698,9 +2698,9 @@ var g = &grammar{ }, }, ¬Expr{ - pos: position{line: 350, col: 50, offset: 11587}, + pos: position{line: 350, col: 50, offset: 11551}, expr: &litMatcher{ - pos: position{line: 350, col: 51, offset: 11588}, + pos: position{line: 350, col: 51, offset: 11552}, val: "=", ignoreCase: false, want: "\"=\"", @@ -2712,81 +2712,81 @@ var g = &grammar{ }, { name: "QuoteAttributes", - pos: position{line: 354, col: 1, offset: 11754}, + pos: position{line: 354, col: 1, offset: 11718}, expr: &actionExpr{ - pos: position{line: 354, col: 20, offset: 11773}, + pos: position{line: 354, col: 20, offset: 11737}, run: (*parser).callonQuoteAttributes1, expr: &seqExpr{ - pos: position{line: 354, col: 20, offset: 11773}, + pos: position{line: 354, col: 20, offset: 11737}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 354, col: 20, offset: 11773}, + pos: position{line: 354, col: 20, offset: 11737}, val: "[quote", ignoreCase: false, want: "\"[quote\"", }, &zeroOrMoreExpr{ - pos: position{line: 354, col: 29, offset: 11782}, + pos: position{line: 354, col: 29, offset: 11746}, expr: &ruleRefExpr{ - pos: position{line: 354, col: 29, offset: 11782}, + pos: position{line: 354, col: 29, offset: 11746}, name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 354, col: 36, offset: 11789}, + pos: position{line: 354, col: 36, offset: 11753}, expr: &litMatcher{ - pos: position{line: 354, col: 36, offset: 11789}, + pos: position{line: 354, col: 36, offset: 11753}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 354, col: 41, offset: 11794}, + pos: position{line: 354, col: 41, offset: 11758}, label: "author", expr: &zeroOrOneExpr{ - pos: position{line: 354, col: 48, offset: 11801}, + pos: position{line: 354, col: 48, offset: 11765}, expr: &ruleRefExpr{ - pos: position{line: 354, col: 49, offset: 11802}, + pos: position{line: 354, col: 49, offset: 11766}, name: "QuoteAttribute", }, }, }, &zeroOrOneExpr{ - pos: position{line: 354, col: 66, offset: 11819}, + pos: position{line: 354, col: 66, offset: 11783}, expr: &litMatcher{ - pos: position{line: 354, col: 66, offset: 11819}, + pos: position{line: 354, col: 66, offset: 11783}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 354, col: 71, offset: 11824}, + pos: position{line: 354, col: 71, offset: 11788}, label: "title", expr: &zeroOrOneExpr{ - pos: position{line: 354, col: 77, offset: 11830}, + pos: position{line: 354, col: 77, offset: 11794}, expr: &ruleRefExpr{ - pos: position{line: 354, col: 78, offset: 11831}, + pos: position{line: 354, col: 78, offset: 11795}, name: "QuoteAttribute", }, }, }, &litMatcher{ - pos: position{line: 354, col: 95, offset: 11848}, + pos: position{line: 354, col: 95, offset: 11812}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 354, col: 99, offset: 11852}, + pos: position{line: 354, col: 99, offset: 11816}, expr: &ruleRefExpr{ - pos: position{line: 354, col: 99, offset: 11852}, + pos: position{line: 354, col: 99, offset: 11816}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 354, col: 106, offset: 11859}, + pos: position{line: 354, col: 106, offset: 11823}, name: "EOL", }, }, @@ -2795,81 +2795,81 @@ var g = &grammar{ }, { name: "VerseAttributes", - pos: position{line: 358, col: 1, offset: 11928}, + pos: position{line: 358, col: 1, offset: 11892}, expr: &actionExpr{ - pos: position{line: 358, col: 20, offset: 11947}, + pos: position{line: 358, col: 20, offset: 11911}, run: (*parser).callonVerseAttributes1, expr: &seqExpr{ - pos: position{line: 358, col: 20, offset: 11947}, + pos: position{line: 358, col: 20, offset: 11911}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 358, col: 20, offset: 11947}, + pos: position{line: 358, col: 20, offset: 11911}, val: "[verse", ignoreCase: false, want: "\"[verse\"", }, &zeroOrMoreExpr{ - pos: position{line: 358, col: 29, offset: 11956}, + pos: position{line: 358, col: 29, offset: 11920}, expr: &ruleRefExpr{ - pos: position{line: 358, col: 29, offset: 11956}, + pos: position{line: 358, col: 29, offset: 11920}, name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 358, col: 36, offset: 11963}, + pos: position{line: 358, col: 36, offset: 11927}, expr: &litMatcher{ - pos: position{line: 358, col: 36, offset: 11963}, + pos: position{line: 358, col: 36, offset: 11927}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 358, col: 41, offset: 11968}, + pos: position{line: 358, col: 41, offset: 11932}, label: "author", expr: &zeroOrOneExpr{ - pos: position{line: 358, col: 48, offset: 11975}, + pos: position{line: 358, col: 48, offset: 11939}, expr: &ruleRefExpr{ - pos: position{line: 358, col: 49, offset: 11976}, + pos: position{line: 358, col: 49, offset: 11940}, name: "QuoteAttribute", }, }, }, &zeroOrOneExpr{ - pos: position{line: 358, col: 66, offset: 11993}, + pos: position{line: 358, col: 66, offset: 11957}, expr: &litMatcher{ - pos: position{line: 358, col: 66, offset: 11993}, + pos: position{line: 358, col: 66, offset: 11957}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 358, col: 71, offset: 11998}, + pos: position{line: 358, col: 71, offset: 11962}, label: "title", expr: &zeroOrOneExpr{ - pos: position{line: 358, col: 77, offset: 12004}, + pos: position{line: 358, col: 77, offset: 11968}, expr: &ruleRefExpr{ - pos: position{line: 358, col: 78, offset: 12005}, + pos: position{line: 358, col: 78, offset: 11969}, name: "QuoteAttribute", }, }, }, &litMatcher{ - pos: position{line: 358, col: 95, offset: 12022}, + pos: position{line: 358, col: 95, offset: 11986}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 358, col: 99, offset: 12026}, + pos: position{line: 358, col: 99, offset: 11990}, expr: &ruleRefExpr{ - pos: position{line: 358, col: 99, offset: 12026}, + pos: position{line: 358, col: 99, offset: 11990}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 358, col: 106, offset: 12033}, + pos: position{line: 358, col: 106, offset: 11997}, name: "EOL", }, }, @@ -2878,14 +2878,14 @@ var g = &grammar{ }, { name: "QuoteAttribute", - pos: position{line: 362, col: 1, offset: 12120}, + pos: position{line: 362, col: 1, offset: 12084}, expr: &actionExpr{ - pos: position{line: 362, col: 19, offset: 12138}, + pos: position{line: 362, col: 19, offset: 12102}, run: (*parser).callonQuoteAttribute1, expr: &zeroOrMoreExpr{ - pos: position{line: 362, col: 20, offset: 12139}, + pos: position{line: 362, col: 20, offset: 12103}, expr: &charClassMatcher{ - pos: position{line: 362, col: 20, offset: 12139}, + pos: position{line: 362, col: 20, offset: 12103}, val: "[^\\r\\n,\\]]", chars: []rune{'\r', '\n', ',', ']'}, ignoreCase: false, @@ -2896,43 +2896,43 @@ var g = &grammar{ }, { name: "QuotedTextAttrs", - pos: position{line: 366, col: 1, offset: 12188}, + pos: position{line: 366, col: 1, offset: 12152}, expr: &actionExpr{ - pos: position{line: 366, col: 20, offset: 12207}, + pos: position{line: 366, col: 20, offset: 12171}, run: (*parser).callonQuotedTextAttrs1, expr: &seqExpr{ - pos: position{line: 366, col: 20, offset: 12207}, + pos: position{line: 366, col: 20, offset: 12171}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 366, col: 20, offset: 12207}, + pos: position{line: 366, col: 20, offset: 12171}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 366, col: 24, offset: 12211}, + pos: position{line: 366, col: 24, offset: 12175}, label: "attrs", expr: &seqExpr{ - pos: position{line: 366, col: 31, offset: 12218}, + pos: position{line: 366, col: 31, offset: 12182}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 366, col: 31, offset: 12218}, + pos: position{line: 366, col: 31, offset: 12182}, expr: &ruleRefExpr{ - pos: position{line: 366, col: 31, offset: 12218}, + pos: position{line: 366, col: 31, offset: 12182}, name: "QuotedTextAttrRole", }, }, &zeroOrMoreExpr{ - pos: position{line: 366, col: 51, offset: 12238}, + pos: position{line: 366, col: 51, offset: 12202}, expr: &ruleRefExpr{ - pos: position{line: 366, col: 51, offset: 12238}, + pos: position{line: 366, col: 51, offset: 12202}, name: "ShortHandAttr", }, }, &zeroOrMoreExpr{ - pos: position{line: 366, col: 66, offset: 12253}, + pos: position{line: 366, col: 66, offset: 12217}, expr: &ruleRefExpr{ - pos: position{line: 366, col: 66, offset: 12253}, + pos: position{line: 366, col: 66, offset: 12217}, name: "NamedAttr", }, }, @@ -2940,7 +2940,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 366, col: 78, offset: 12265}, + pos: position{line: 366, col: 78, offset: 12229}, val: "]", ignoreCase: false, want: "\"]\"", @@ -2951,15 +2951,15 @@ var g = &grammar{ }, { name: "QuotedTextAttrRole", - pos: position{line: 370, col: 1, offset: 12319}, + pos: position{line: 370, col: 1, offset: 12283}, expr: &actionExpr{ - pos: position{line: 370, col: 23, offset: 12341}, + pos: position{line: 370, col: 23, offset: 12305}, run: (*parser).callonQuotedTextAttrRole1, expr: &labeledExpr{ - pos: position{line: 370, col: 23, offset: 12341}, + pos: position{line: 370, col: 23, offset: 12305}, label: "role", expr: &ruleRefExpr{ - pos: position{line: 370, col: 28, offset: 12346}, + pos: position{line: 370, col: 28, offset: 12310}, name: "PositionalValue", }, }, @@ -2967,33 +2967,33 @@ var g = &grammar{ }, { name: "StandaloneAttributes", - pos: position{line: 374, col: 1, offset: 12414}, + pos: position{line: 374, col: 1, offset: 12369}, expr: &actionExpr{ - pos: position{line: 374, col: 25, offset: 12438}, + pos: position{line: 374, col: 25, offset: 12393}, run: (*parser).callonStandaloneAttributes1, expr: &seqExpr{ - pos: position{line: 374, col: 25, offset: 12438}, + pos: position{line: 374, col: 25, offset: 12393}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 374, col: 25, offset: 12438}, + pos: position{line: 374, col: 25, offset: 12393}, label: "attributes", expr: &oneOrMoreExpr{ - pos: position{line: 374, col: 36, offset: 12449}, + pos: position{line: 374, col: 36, offset: 12404}, expr: &ruleRefExpr{ - pos: position{line: 374, col: 37, offset: 12450}, + pos: position{line: 374, col: 37, offset: 12405}, name: "ElementAttribute", }, }, }, &zeroOrMoreExpr{ - pos: position{line: 374, col: 56, offset: 12469}, + pos: position{line: 374, col: 56, offset: 12424}, expr: &ruleRefExpr{ - pos: position{line: 374, col: 56, offset: 12469}, + pos: position{line: 374, col: 56, offset: 12424}, name: "BlankLine", }, }, &ruleRefExpr{ - pos: position{line: 374, col: 67, offset: 12480}, + pos: position{line: 374, col: 67, offset: 12435}, name: "EOF", }, }, @@ -3002,20 +3002,20 @@ var g = &grammar{ }, { name: "ShortHandAttr", - pos: position{line: 378, col: 1, offset: 12588}, + pos: position{line: 378, col: 1, offset: 12543}, expr: &choiceExpr{ - pos: position{line: 378, col: 18, offset: 12605}, + pos: position{line: 378, col: 18, offset: 12560}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 378, col: 18, offset: 12605}, + pos: position{line: 378, col: 18, offset: 12560}, name: "ShortHandAttrID", }, &ruleRefExpr{ - pos: position{line: 378, col: 36, offset: 12623}, + pos: position{line: 378, col: 36, offset: 12578}, name: "ShortHandAttrOption", }, &ruleRefExpr{ - pos: position{line: 378, col: 58, offset: 12645}, + pos: position{line: 378, col: 58, offset: 12600}, name: "ShortHandAttrRole", }, }, @@ -3023,31 +3023,31 @@ var g = &grammar{ }, { name: "ShortHandAttrOption", - pos: position{line: 380, col: 1, offset: 12664}, + pos: position{line: 380, col: 1, offset: 12619}, expr: &actionExpr{ - pos: position{line: 380, col: 24, offset: 12687}, + pos: position{line: 380, col: 24, offset: 12642}, run: (*parser).callonShortHandAttrOption1, expr: &seqExpr{ - pos: position{line: 380, col: 24, offset: 12687}, + pos: position{line: 380, col: 24, offset: 12642}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 380, col: 24, offset: 12687}, + pos: position{line: 380, col: 24, offset: 12642}, val: "%", ignoreCase: false, want: "\"%\"", }, &labeledExpr{ - pos: position{line: 380, col: 28, offset: 12691}, + pos: position{line: 380, col: 28, offset: 12646}, label: "option", expr: &ruleRefExpr{ - pos: position{line: 380, col: 35, offset: 12698}, + pos: position{line: 380, col: 35, offset: 12653}, name: "ShortHandValue", }, }, &andExpr{ - pos: position{line: 380, col: 50, offset: 12713}, + pos: position{line: 380, col: 50, offset: 12668}, expr: &charClassMatcher{ - pos: position{line: 380, col: 51, offset: 12714}, + pos: position{line: 380, col: 51, offset: 12669}, val: "[,#%.\\r\\n\\]]", chars: []rune{',', '#', '%', '.', '\r', '\n', ']'}, ignoreCase: false, @@ -3060,31 +3060,31 @@ var g = &grammar{ }, { name: "ShortHandAttrID", - pos: position{line: 384, col: 1, offset: 12783}, + pos: position{line: 384, col: 1, offset: 12729}, expr: &actionExpr{ - pos: position{line: 384, col: 20, offset: 12802}, + pos: position{line: 384, col: 20, offset: 12748}, run: (*parser).callonShortHandAttrID1, expr: &seqExpr{ - pos: position{line: 384, col: 20, offset: 12802}, + pos: position{line: 384, col: 20, offset: 12748}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 384, col: 20, offset: 12802}, + pos: position{line: 384, col: 20, offset: 12748}, val: "#", ignoreCase: false, want: "\"#\"", }, &labeledExpr{ - pos: position{line: 384, col: 24, offset: 12806}, + pos: position{line: 384, col: 24, offset: 12752}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 384, col: 27, offset: 12809}, + pos: position{line: 384, col: 27, offset: 12755}, name: "ShortHandValue", }, }, &andExpr{ - pos: position{line: 384, col: 42, offset: 12824}, + pos: position{line: 384, col: 42, offset: 12770}, expr: &charClassMatcher{ - pos: position{line: 384, col: 43, offset: 12825}, + pos: position{line: 384, col: 43, offset: 12771}, val: "[,#%.\\r\\n\\]]", chars: []rune{',', '#', '%', '.', '\r', '\n', ']'}, ignoreCase: false, @@ -3097,31 +3097,31 @@ var g = &grammar{ }, { name: "ShortHandAttrRole", - pos: position{line: 388, col: 1, offset: 12886}, + pos: position{line: 388, col: 1, offset: 12823}, expr: &actionExpr{ - pos: position{line: 388, col: 22, offset: 12907}, + pos: position{line: 388, col: 22, offset: 12844}, run: (*parser).callonShortHandAttrRole1, expr: &seqExpr{ - pos: position{line: 388, col: 22, offset: 12907}, + pos: position{line: 388, col: 22, offset: 12844}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 388, col: 22, offset: 12907}, + pos: position{line: 388, col: 22, offset: 12844}, val: ".", ignoreCase: false, want: "\".\"", }, &labeledExpr{ - pos: position{line: 388, col: 26, offset: 12911}, + pos: position{line: 388, col: 26, offset: 12848}, label: "role", expr: &ruleRefExpr{ - pos: position{line: 388, col: 31, offset: 12916}, + pos: position{line: 388, col: 31, offset: 12853}, name: "ShortHandValue", }, }, &andExpr{ - pos: position{line: 388, col: 46, offset: 12931}, + pos: position{line: 388, col: 46, offset: 12868}, expr: &charClassMatcher{ - pos: position{line: 388, col: 47, offset: 12932}, + pos: position{line: 388, col: 47, offset: 12869}, val: "[,#%.\\r\\n\\]]", chars: []rune{',', '#', '%', '.', '\r', '\n', ']'}, ignoreCase: false, @@ -3134,25 +3134,25 @@ var g = &grammar{ }, { name: "PositionalValue", - pos: position{line: 393, col: 1, offset: 13041}, + pos: position{line: 393, col: 1, offset: 12969}, expr: &actionExpr{ - pos: position{line: 393, col: 20, offset: 13060}, + pos: position{line: 393, col: 20, offset: 12988}, run: (*parser).callonPositionalValue1, expr: &seqExpr{ - pos: position{line: 393, col: 20, offset: 13060}, + pos: position{line: 393, col: 20, offset: 12988}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 393, col: 20, offset: 13060}, + pos: position{line: 393, col: 20, offset: 12988}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 393, col: 26, offset: 13066}, + pos: position{line: 393, col: 26, offset: 12994}, name: "ShortHandValue", }, }, &andExpr{ - pos: position{line: 393, col: 41, offset: 13081}, + pos: position{line: 393, col: 41, offset: 13009}, expr: &charClassMatcher{ - pos: position{line: 393, col: 42, offset: 13082}, + pos: position{line: 393, col: 42, offset: 13010}, val: "[,#%.\\]]", chars: []rune{',', '#', '%', '.', ']'}, ignoreCase: false, @@ -3165,24 +3165,24 @@ var g = &grammar{ }, { name: "InlineVal", - pos: position{line: 397, col: 1, offset: 13127}, + pos: position{line: 397, col: 1, offset: 13046}, expr: &choiceExpr{ - pos: position{line: 397, col: 14, offset: 13140}, + pos: position{line: 397, col: 14, offset: 13059}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 397, col: 14, offset: 13140}, + pos: position{line: 397, col: 14, offset: 13059}, name: "AttrEmpty", }, &ruleRefExpr{ - pos: position{line: 397, col: 26, offset: 13152}, + pos: position{line: 397, col: 26, offset: 13071}, name: "AttrValSQ", }, &ruleRefExpr{ - pos: position{line: 397, col: 38, offset: 13164}, + pos: position{line: 397, col: 38, offset: 13083}, name: "AttrValDQ", }, &ruleRefExpr{ - pos: position{line: 397, col: 50, offset: 13176}, + pos: position{line: 397, col: 50, offset: 13095}, name: "AttrValPosFB", }, }, @@ -3190,17 +3190,17 @@ var g = &grammar{ }, { name: "NamedAttrs", - pos: position{line: 399, col: 1, offset: 13190}, + pos: position{line: 399, col: 1, offset: 13109}, expr: &actionExpr{ - pos: position{line: 399, col: 15, offset: 13204}, + pos: position{line: 399, col: 15, offset: 13123}, run: (*parser).callonNamedAttrs1, expr: &labeledExpr{ - pos: position{line: 399, col: 15, offset: 13204}, + pos: position{line: 399, col: 15, offset: 13123}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 399, col: 21, offset: 13210}, + pos: position{line: 399, col: 21, offset: 13129}, expr: &ruleRefExpr{ - pos: position{line: 399, col: 21, offset: 13210}, + pos: position{line: 399, col: 21, offset: 13129}, name: "NamedAttrPair", }, }, @@ -3209,66 +3209,66 @@ var g = &grammar{ }, { name: "NamedAttrPair", - pos: position{line: 403, col: 1, offset: 13275}, + pos: position{line: 403, col: 1, offset: 13194}, expr: &actionExpr{ - pos: position{line: 403, col: 18, offset: 13292}, + pos: position{line: 403, col: 18, offset: 13211}, run: (*parser).callonNamedAttrPair1, expr: &seqExpr{ - pos: position{line: 403, col: 18, offset: 13292}, + pos: position{line: 403, col: 18, offset: 13211}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 403, col: 18, offset: 13292}, + pos: position{line: 403, col: 18, offset: 13211}, expr: &litMatcher{ - pos: position{line: 403, col: 18, offset: 13292}, + pos: position{line: 403, col: 18, offset: 13211}, val: ",", ignoreCase: false, want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 403, col: 23, offset: 13297}, + pos: position{line: 403, col: 23, offset: 13216}, expr: &ruleRefExpr{ - pos: position{line: 403, col: 23, offset: 13297}, + pos: position{line: 403, col: 23, offset: 13216}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 403, col: 30, offset: 13304}, + pos: position{line: 403, col: 30, offset: 13223}, label: "n", expr: &ruleRefExpr{ - pos: position{line: 403, col: 32, offset: 13306}, + pos: position{line: 403, col: 32, offset: 13225}, name: "NamedAttrKey", }, }, &zeroOrMoreExpr{ - pos: position{line: 403, col: 45, offset: 13319}, + pos: position{line: 403, col: 45, offset: 13238}, expr: &ruleRefExpr{ - pos: position{line: 403, col: 45, offset: 13319}, + pos: position{line: 403, col: 45, offset: 13238}, name: "Space", }, }, &litMatcher{ - pos: position{line: 403, col: 52, offset: 13326}, + pos: position{line: 403, col: 52, offset: 13245}, val: "=", ignoreCase: false, want: "\"=\"", }, &labeledExpr{ - pos: position{line: 403, col: 56, offset: 13330}, + pos: position{line: 403, col: 56, offset: 13249}, label: "v", expr: &choiceExpr{ - pos: position{line: 403, col: 59, offset: 13333}, + pos: position{line: 403, col: 59, offset: 13252}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 403, col: 59, offset: 13333}, + pos: position{line: 403, col: 59, offset: 13252}, name: "AttrValDQ", }, &ruleRefExpr{ - pos: position{line: 403, col: 71, offset: 13345}, + pos: position{line: 403, col: 71, offset: 13264}, name: "AttrValSQ", }, &ruleRefExpr{ - pos: position{line: 403, col: 83, offset: 13357}, + pos: position{line: 403, col: 83, offset: 13276}, name: "AttrValNamedFB", }, }, @@ -3280,17 +3280,17 @@ var g = &grammar{ }, { name: "AttrEmpty", - pos: position{line: 408, col: 1, offset: 13546}, + pos: position{line: 408, col: 1, offset: 13465}, expr: &actionExpr{ - pos: position{line: 408, col: 14, offset: 13559}, + pos: position{line: 408, col: 14, offset: 13478}, run: (*parser).callonAttrEmpty1, expr: &seqExpr{ - pos: position{line: 408, col: 14, offset: 13559}, + pos: position{line: 408, col: 14, offset: 13478}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 408, col: 14, offset: 13559}, + pos: position{line: 408, col: 14, offset: 13478}, expr: &charClassMatcher{ - pos: position{line: 408, col: 14, offset: 13559}, + pos: position{line: 408, col: 14, offset: 13478}, val: "[ \\t]", chars: []rune{' ', '\t'}, ignoreCase: false, @@ -3298,9 +3298,9 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 408, col: 21, offset: 13566}, + pos: position{line: 408, col: 21, offset: 13485}, expr: &charClassMatcher{ - pos: position{line: 408, col: 22, offset: 13567}, + pos: position{line: 408, col: 22, offset: 13486}, val: "[,\\]]", chars: []rune{',', ']'}, ignoreCase: false, @@ -3313,51 +3313,51 @@ var g = &grammar{ }, { name: "AttrValSQ", - pos: position{line: 414, col: 1, offset: 13703}, + pos: position{line: 414, col: 1, offset: 13622}, expr: &actionExpr{ - pos: position{line: 414, col: 14, offset: 13716}, + pos: position{line: 414, col: 14, offset: 13635}, run: (*parser).callonAttrValSQ1, expr: &seqExpr{ - pos: position{line: 414, col: 14, offset: 13716}, + pos: position{line: 414, col: 14, offset: 13635}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 414, col: 14, offset: 13716}, + pos: position{line: 414, col: 14, offset: 13635}, expr: &ruleRefExpr{ - pos: position{line: 414, col: 14, offset: 13716}, + pos: position{line: 414, col: 14, offset: 13635}, name: "Space", }, }, &litMatcher{ - pos: position{line: 414, col: 21, offset: 13723}, + pos: position{line: 414, col: 21, offset: 13642}, val: "'", ignoreCase: false, want: "\"'\"", }, &labeledExpr{ - pos: position{line: 414, col: 25, offset: 13727}, + pos: position{line: 414, col: 25, offset: 13646}, label: "val", expr: &ruleRefExpr{ - pos: position{line: 414, col: 29, offset: 13731}, + pos: position{line: 414, col: 29, offset: 13650}, name: "AttrValSQin", }, }, &litMatcher{ - pos: position{line: 414, col: 41, offset: 13743}, + pos: position{line: 414, col: 41, offset: 13662}, val: "'", ignoreCase: false, want: "\"'\"", }, &zeroOrMoreExpr{ - pos: position{line: 414, col: 45, offset: 13747}, + pos: position{line: 414, col: 45, offset: 13666}, expr: &ruleRefExpr{ - pos: position{line: 414, col: 45, offset: 13747}, + pos: position{line: 414, col: 45, offset: 13666}, name: "Space", }, }, &andExpr{ - pos: position{line: 414, col: 52, offset: 13754}, + pos: position{line: 414, col: 52, offset: 13673}, expr: &charClassMatcher{ - pos: position{line: 414, col: 53, offset: 13755}, + pos: position{line: 414, col: 53, offset: 13674}, val: "[,\\]]", chars: []rune{',', ']'}, ignoreCase: false, @@ -3370,26 +3370,26 @@ var g = &grammar{ }, { name: "AttrValSQin", - pos: position{line: 416, col: 1, offset: 13782}, + pos: position{line: 416, col: 1, offset: 13701}, expr: &actionExpr{ - pos: position{line: 416, col: 16, offset: 13797}, + pos: position{line: 416, col: 16, offset: 13716}, run: (*parser).callonAttrValSQin1, expr: &labeledExpr{ - pos: position{line: 416, col: 16, offset: 13797}, + pos: position{line: 416, col: 16, offset: 13716}, label: "val", expr: &zeroOrMoreExpr{ - pos: position{line: 416, col: 20, offset: 13801}, + pos: position{line: 416, col: 20, offset: 13720}, expr: &choiceExpr{ - pos: position{line: 416, col: 22, offset: 13803}, + pos: position{line: 416, col: 22, offset: 13722}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 416, col: 22, offset: 13803}, + pos: position{line: 416, col: 22, offset: 13722}, name: "AttrValSQEsc", }, &oneOrMoreExpr{ - pos: position{line: 416, col: 37, offset: 13818}, + pos: position{line: 416, col: 37, offset: 13737}, expr: &charClassMatcher{ - pos: position{line: 416, col: 37, offset: 13818}, + pos: position{line: 416, col: 37, offset: 13737}, val: "[^\\r\\n'\\\\]", chars: []rune{'\r', '\n', '\'', '\\'}, ignoreCase: false, @@ -3397,7 +3397,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 416, col: 51, offset: 13832}, + pos: position{line: 416, col: 51, offset: 13751}, val: "\\", ignoreCase: false, want: "\"\\\\\"", @@ -3410,12 +3410,12 @@ var g = &grammar{ }, { name: "AttrValSQEsc", - pos: position{line: 418, col: 1, offset: 13872}, + pos: position{line: 418, col: 1, offset: 13791}, expr: &actionExpr{ - pos: position{line: 418, col: 17, offset: 13888}, + pos: position{line: 418, col: 17, offset: 13807}, run: (*parser).callonAttrValSQEsc1, expr: &litMatcher{ - pos: position{line: 418, col: 17, offset: 13888}, + pos: position{line: 418, col: 17, offset: 13807}, val: "\\'", ignoreCase: false, want: "\"\\\\'\"", @@ -3424,44 +3424,44 @@ var g = &grammar{ }, { name: "AttrValDQ", - pos: position{line: 421, col: 1, offset: 13948}, + pos: position{line: 421, col: 1, offset: 13867}, expr: &actionExpr{ - pos: position{line: 421, col: 14, offset: 13961}, + pos: position{line: 421, col: 14, offset: 13880}, run: (*parser).callonAttrValDQ1, expr: &seqExpr{ - pos: position{line: 421, col: 14, offset: 13961}, + pos: position{line: 421, col: 14, offset: 13880}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 421, col: 14, offset: 13961}, + pos: position{line: 421, col: 14, offset: 13880}, expr: &ruleRefExpr{ - pos: position{line: 421, col: 14, offset: 13961}, + pos: position{line: 421, col: 14, offset: 13880}, name: "Space", }, }, &litMatcher{ - pos: position{line: 421, col: 21, offset: 13968}, + pos: position{line: 421, col: 21, offset: 13887}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 421, col: 25, offset: 13972}, + pos: position{line: 421, col: 25, offset: 13891}, label: "val", expr: &ruleRefExpr{ - pos: position{line: 421, col: 29, offset: 13976}, + pos: position{line: 421, col: 29, offset: 13895}, name: "AttrValDQin", }, }, &litMatcher{ - pos: position{line: 421, col: 41, offset: 13988}, + pos: position{line: 421, col: 41, offset: 13907}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &zeroOrMoreExpr{ - pos: position{line: 421, col: 45, offset: 13992}, + pos: position{line: 421, col: 45, offset: 13911}, expr: &ruleRefExpr{ - pos: position{line: 421, col: 45, offset: 13992}, + pos: position{line: 421, col: 45, offset: 13911}, name: "Space", }, }, @@ -3471,26 +3471,26 @@ var g = &grammar{ }, { name: "AttrValDQin", - pos: position{line: 423, col: 1, offset: 14020}, + pos: position{line: 423, col: 1, offset: 13939}, expr: &actionExpr{ - pos: position{line: 423, col: 16, offset: 14035}, + pos: position{line: 423, col: 16, offset: 13954}, run: (*parser).callonAttrValDQin1, expr: &labeledExpr{ - pos: position{line: 423, col: 16, offset: 14035}, + pos: position{line: 423, col: 16, offset: 13954}, label: "val", expr: &zeroOrMoreExpr{ - pos: position{line: 423, col: 20, offset: 14039}, + pos: position{line: 423, col: 20, offset: 13958}, expr: &choiceExpr{ - pos: position{line: 423, col: 22, offset: 14041}, + pos: position{line: 423, col: 22, offset: 13960}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 423, col: 22, offset: 14041}, + pos: position{line: 423, col: 22, offset: 13960}, name: "AttrValDQEsc", }, &oneOrMoreExpr{ - pos: position{line: 423, col: 37, offset: 14056}, + pos: position{line: 423, col: 37, offset: 13975}, expr: &charClassMatcher{ - pos: position{line: 423, col: 37, offset: 14056}, + pos: position{line: 423, col: 37, offset: 13975}, val: "[^\\r\\n\"\\\\]", chars: []rune{'\r', '\n', '"', '\\'}, ignoreCase: false, @@ -3498,7 +3498,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 423, col: 51, offset: 14070}, + pos: position{line: 423, col: 51, offset: 13989}, val: "\\", ignoreCase: false, want: "\"\\\\\"", @@ -3511,12 +3511,12 @@ var g = &grammar{ }, { name: "AttrValDQEsc", - pos: position{line: 425, col: 1, offset: 14110}, + pos: position{line: 425, col: 1, offset: 14029}, expr: &actionExpr{ - pos: position{line: 425, col: 17, offset: 14126}, + pos: position{line: 425, col: 17, offset: 14045}, run: (*parser).callonAttrValDQEsc1, expr: &litMatcher{ - pos: position{line: 425, col: 17, offset: 14126}, + pos: position{line: 425, col: 17, offset: 14045}, val: "\\\"", ignoreCase: false, want: "\"\\\\\\\"\"", @@ -3525,17 +3525,17 @@ var g = &grammar{ }, { name: "AttrValPosFB", - pos: position{line: 428, col: 1, offset: 14217}, + pos: position{line: 428, col: 1, offset: 14136}, expr: &actionExpr{ - pos: position{line: 428, col: 17, offset: 14233}, + pos: position{line: 428, col: 17, offset: 14152}, run: (*parser).callonAttrValPosFB1, expr: &seqExpr{ - pos: position{line: 428, col: 17, offset: 14233}, + pos: position{line: 428, col: 17, offset: 14152}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 428, col: 17, offset: 14233}, + pos: position{line: 428, col: 17, offset: 14152}, expr: &charClassMatcher{ - pos: position{line: 428, col: 17, offset: 14233}, + pos: position{line: 428, col: 17, offset: 14152}, val: "[^,=\\r\\n\\]]", chars: []rune{',', '=', '\r', '\n', ']'}, ignoreCase: false, @@ -3543,9 +3543,9 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 428, col: 30, offset: 14246}, + pos: position{line: 428, col: 30, offset: 14165}, expr: &charClassMatcher{ - pos: position{line: 428, col: 31, offset: 14247}, + pos: position{line: 428, col: 31, offset: 14166}, val: "[,\\]]", chars: []rune{',', ']'}, ignoreCase: false, @@ -3558,17 +3558,17 @@ var g = &grammar{ }, { name: "AttrValNamedFB", - pos: position{line: 431, col: 1, offset: 14358}, + pos: position{line: 431, col: 1, offset: 14277}, expr: &actionExpr{ - pos: position{line: 431, col: 19, offset: 14376}, + pos: position{line: 431, col: 19, offset: 14295}, run: (*parser).callonAttrValNamedFB1, expr: &seqExpr{ - pos: position{line: 431, col: 19, offset: 14376}, + pos: position{line: 431, col: 19, offset: 14295}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 431, col: 19, offset: 14376}, + pos: position{line: 431, col: 19, offset: 14295}, expr: &charClassMatcher{ - pos: position{line: 431, col: 19, offset: 14376}, + pos: position{line: 431, col: 19, offset: 14295}, val: "[^,\\r\\n\\]]", chars: []rune{',', '\r', '\n', ']'}, ignoreCase: false, @@ -3576,9 +3576,9 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 431, col: 31, offset: 14388}, + pos: position{line: 431, col: 31, offset: 14307}, expr: &charClassMatcher{ - pos: position{line: 431, col: 32, offset: 14389}, + pos: position{line: 431, col: 32, offset: 14308}, val: "[,\\]]", chars: []rune{',', ']'}, ignoreCase: false, @@ -3591,20 +3591,20 @@ var g = &grammar{ }, { name: "ShortHandValue", - pos: position{line: 433, col: 1, offset: 14446}, + pos: position{line: 433, col: 1, offset: 14365}, expr: &choiceExpr{ - pos: position{line: 433, col: 19, offset: 14464}, + pos: position{line: 433, col: 19, offset: 14383}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 433, col: 19, offset: 14464}, + pos: position{line: 433, col: 19, offset: 14383}, name: "ShortHandValuePlain", }, &ruleRefExpr{ - pos: position{line: 433, col: 41, offset: 14486}, + pos: position{line: 433, col: 41, offset: 14405}, name: "AttrValueSingleQuoted", }, &ruleRefExpr{ - pos: position{line: 433, col: 65, offset: 14510}, + pos: position{line: 433, col: 65, offset: 14429}, name: "AttrValueDoubleQuoted", }, }, @@ -3612,48 +3612,73 @@ var g = &grammar{ }, { name: "ShortHandValuePlain", - pos: position{line: 437, col: 1, offset: 14708}, + pos: position{line: 440, col: 1, offset: 14762}, expr: &actionExpr{ - pos: position{line: 437, col: 24, offset: 14731}, + pos: position{line: 440, col: 24, offset: 14785}, run: (*parser).callonShortHandValuePlain1, expr: &seqExpr{ - pos: position{line: 437, col: 24, offset: 14731}, + pos: position{line: 440, col: 24, offset: 14785}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 437, col: 24, offset: 14731}, - val: "[^,\\r\\n\"' \\t.#%=\\]]", - chars: []rune{',', '\r', '\n', '"', '\'', ' ', '\t', '.', '#', '%', '=', ']'}, - ignoreCase: false, - inverted: true, + &labeledExpr{ + pos: position{line: 440, col: 24, offset: 14785}, + label: "first", + expr: &actionExpr{ + pos: position{line: 440, col: 31, offset: 14792}, + run: (*parser).callonShortHandValuePlain4, + expr: &charClassMatcher{ + pos: position{line: 440, col: 31, offset: 14792}, + val: "[^,\\r\\n\"' \\t.#%=\\]]", + chars: []rune{',', '\r', '\n', '"', '\'', ' ', '\t', '.', '#', '%', '=', ']'}, + ignoreCase: false, + inverted: true, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 437, col: 45, offset: 14752}, - expr: &choiceExpr{ - pos: position{line: 437, col: 46, offset: 14753}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 437, col: 46, offset: 14753}, - val: "[^ \\t,\\r\\n\"'.#%=\\]]", - chars: []rune{' ', '\t', ',', '\r', '\n', '"', '\'', '.', '#', '%', '=', ']'}, - ignoreCase: false, - inverted: true, - }, - &seqExpr{ - pos: position{line: 437, col: 68, offset: 14775}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 437, col: 68, offset: 14775}, - val: "[ \\t]", - chars: []rune{' ', '\t'}, - ignoreCase: false, - inverted: false, - }, - &charClassMatcher{ - pos: position{line: 437, col: 73, offset: 14780}, - val: "[^ \\t,\\r\\n\"'.#%=\\]]", - chars: []rune{' ', '\t', ',', '\r', '\n', '"', '\'', '.', '#', '%', '=', ']'}, - ignoreCase: false, - inverted: true, + &labeledExpr{ + pos: position{line: 443, col: 5, offset: 14878}, + label: "others", + expr: &zeroOrMoreExpr{ + pos: position{line: 443, col: 13, offset: 14886}, + expr: &choiceExpr{ + pos: position{line: 443, col: 14, offset: 14887}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 443, col: 14, offset: 14887}, + name: "ElementPlaceHolder", + }, + &choiceExpr{ + pos: position{line: 444, col: 12, offset: 14918}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 444, col: 12, offset: 14918}, + val: "[^ \\t,\\r\\n\"'.#%=\\]]", + chars: []rune{' ', '\t', ',', '\r', '\n', '"', '\'', '.', '#', '%', '=', ']'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 444, col: 34, offset: 14940}, + run: (*parser).callonShortHandValuePlain12, + expr: &seqExpr{ + pos: position{line: 444, col: 34, offset: 14940}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 444, col: 34, offset: 14940}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + &charClassMatcher{ + pos: position{line: 444, col: 39, offset: 14945}, + val: "[^ \\t,\\r\\n\"'.#%=\\]]", + chars: []rune{' ', '\t', ',', '\r', '\n', '"', '\'', '.', '#', '%', '=', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, }, }, @@ -3666,28 +3691,28 @@ var g = &grammar{ }, { name: "NamedAttr", - pos: position{line: 441, col: 1, offset: 14838}, + pos: position{line: 451, col: 1, offset: 15128}, expr: &actionExpr{ - pos: position{line: 441, col: 13, offset: 14850}, + pos: position{line: 451, col: 13, offset: 15140}, run: (*parser).callonNamedAttr1, expr: &seqExpr{ - pos: position{line: 441, col: 13, offset: 14850}, + pos: position{line: 451, col: 13, offset: 15140}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 441, col: 13, offset: 14850}, + pos: position{line: 451, col: 13, offset: 15140}, expr: &seqExpr{ - pos: position{line: 441, col: 15, offset: 14852}, + pos: position{line: 451, col: 15, offset: 15142}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 441, col: 15, offset: 14852}, + pos: position{line: 451, col: 15, offset: 15142}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 441, col: 19, offset: 14856}, + pos: position{line: 451, col: 19, offset: 15146}, expr: &ruleRefExpr{ - pos: position{line: 441, col: 19, offset: 14856}, + pos: position{line: 451, col: 19, offset: 15146}, name: "Space", }, }, @@ -3695,45 +3720,45 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 441, col: 29, offset: 14866}, + pos: position{line: 451, col: 29, offset: 15156}, label: "key", expr: &ruleRefExpr{ - pos: position{line: 441, col: 33, offset: 14870}, + pos: position{line: 451, col: 33, offset: 15160}, name: "NamedAttrKey", }, }, &zeroOrMoreExpr{ - pos: position{line: 441, col: 46, offset: 14883}, + pos: position{line: 451, col: 46, offset: 15173}, expr: &ruleRefExpr{ - pos: position{line: 441, col: 46, offset: 14883}, + pos: position{line: 451, col: 46, offset: 15173}, name: "Space", }, }, &litMatcher{ - pos: position{line: 441, col: 53, offset: 14890}, + pos: position{line: 451, col: 53, offset: 15180}, val: "=", ignoreCase: false, want: "\"=\"", }, &zeroOrMoreExpr{ - pos: position{line: 441, col: 57, offset: 14894}, + pos: position{line: 451, col: 57, offset: 15184}, expr: &ruleRefExpr{ - pos: position{line: 441, col: 57, offset: 14894}, + pos: position{line: 451, col: 57, offset: 15184}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 441, col: 64, offset: 14901}, + pos: position{line: 451, col: 64, offset: 15191}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 441, col: 70, offset: 14907}, + pos: position{line: 451, col: 70, offset: 15197}, name: "NamedAttrValue", }, }, &zeroOrMoreExpr{ - pos: position{line: 441, col: 85, offset: 14922}, + pos: position{line: 451, col: 85, offset: 15212}, expr: &ruleRefExpr{ - pos: position{line: 441, col: 85, offset: 14922}, + pos: position{line: 451, col: 85, offset: 15212}, name: "Space", }, }, @@ -3743,15 +3768,15 @@ var g = &grammar{ }, { name: "NamedAttrKey", - pos: position{line: 446, col: 1, offset: 15112}, + pos: position{line: 456, col: 1, offset: 15393}, expr: &actionExpr{ - pos: position{line: 446, col: 17, offset: 15128}, + pos: position{line: 456, col: 17, offset: 15409}, run: (*parser).callonNamedAttrKey1, expr: &seqExpr{ - pos: position{line: 446, col: 17, offset: 15128}, + pos: position{line: 456, col: 17, offset: 15409}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 446, col: 17, offset: 15128}, + pos: position{line: 456, col: 17, offset: 15409}, val: "[\\pL0-9_]", chars: []rune{'_'}, ranges: []rune{'0', '9'}, @@ -3760,9 +3785,9 @@ var g = &grammar{ inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 446, col: 26, offset: 15137}, + pos: position{line: 456, col: 26, offset: 15418}, expr: &charClassMatcher{ - pos: position{line: 446, col: 26, offset: 15137}, + pos: position{line: 456, col: 26, offset: 15418}, val: "[\\pL0-9_-]", chars: []rune{'_', '-'}, ranges: []rune{'0', '9'}, @@ -3777,24 +3802,24 @@ var g = &grammar{ }, { name: "NamedAttrValue", - pos: position{line: 450, col: 1, offset: 15185}, + pos: position{line: 460, col: 1, offset: 15466}, expr: &choiceExpr{ - pos: position{line: 450, col: 19, offset: 15203}, + pos: position{line: 460, col: 19, offset: 15484}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 450, col: 19, offset: 15203}, + pos: position{line: 460, col: 19, offset: 15484}, name: "AttrValueNone", }, &ruleRefExpr{ - pos: position{line: 450, col: 35, offset: 15219}, + pos: position{line: 460, col: 35, offset: 15500}, name: "AttrValueSingleQuoted", }, &ruleRefExpr{ - pos: position{line: 450, col: 59, offset: 15243}, + pos: position{line: 460, col: 59, offset: 15524}, name: "AttrValueDoubleQuoted", }, &ruleRefExpr{ - pos: position{line: 450, col: 83, offset: 15267}, + pos: position{line: 460, col: 83, offset: 15548}, name: "AttrValuePlain", }, }, @@ -3802,14 +3827,14 @@ var g = &grammar{ }, { name: "AttrValuePlain", - pos: position{line: 452, col: 1, offset: 15283}, + pos: position{line: 462, col: 1, offset: 15564}, expr: &actionExpr{ - pos: position{line: 452, col: 19, offset: 15301}, + pos: position{line: 462, col: 19, offset: 15582}, run: (*parser).callonAttrValuePlain1, expr: &oneOrMoreExpr{ - pos: position{line: 452, col: 19, offset: 15301}, + pos: position{line: 462, col: 19, offset: 15582}, expr: &charClassMatcher{ - pos: position{line: 452, col: 19, offset: 15301}, + pos: position{line: 462, col: 19, offset: 15582}, val: "[^,\\r\\n\"' \\t\\]]", chars: []rune{',', '\r', '\n', '"', '\'', ' ', '\t', ']'}, ignoreCase: false, @@ -3820,31 +3845,51 @@ var g = &grammar{ }, { name: "AttrValueSingleQuoted", - pos: position{line: 456, col: 1, offset: 15354}, + pos: position{line: 466, col: 1, offset: 15635}, expr: &actionExpr{ - pos: position{line: 456, col: 26, offset: 15379}, + pos: position{line: 466, col: 26, offset: 15660}, run: (*parser).callonAttrValueSingleQuoted1, expr: &seqExpr{ - pos: position{line: 456, col: 26, offset: 15379}, + pos: position{line: 466, col: 26, offset: 15660}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 456, col: 26, offset: 15379}, + pos: position{line: 466, col: 26, offset: 15660}, val: "'", ignoreCase: false, want: "\"'\"", }, - &oneOrMoreExpr{ - pos: position{line: 456, col: 30, offset: 15383}, - expr: &charClassMatcher{ - pos: position{line: 456, col: 30, offset: 15383}, - val: "[^'\\r\\n]", - chars: []rune{'\'', '\r', '\n'}, - ignoreCase: false, - inverted: true, + &labeledExpr{ + pos: position{line: 466, col: 30, offset: 15664}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 466, col: 39, offset: 15673}, + expr: &choiceExpr{ + pos: position{line: 467, col: 5, offset: 15679}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 467, col: 6, offset: 15680}, + run: (*parser).callonAttrValueSingleQuoted7, + expr: &oneOrMoreExpr{ + pos: position{line: 467, col: 6, offset: 15680}, + expr: &charClassMatcher{ + pos: position{line: 467, col: 6, offset: 15680}, + val: "[^'\\r\\n\\uFFFD]", + chars: []rune{'\'', '\r', '\n', '�'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 469, col: 10, offset: 15762}, + name: "ElementPlaceHolder", + }, + }, + }, }, }, &litMatcher{ - pos: position{line: 456, col: 40, offset: 15393}, + pos: position{line: 469, col: 31, offset: 15783}, val: "'", ignoreCase: false, want: "\"'\"", @@ -3855,31 +3900,51 @@ var g = &grammar{ }, { name: "AttrValueDoubleQuoted", - pos: position{line: 460, col: 1, offset: 15450}, + pos: position{line: 473, col: 1, offset: 15825}, expr: &actionExpr{ - pos: position{line: 460, col: 26, offset: 15475}, + pos: position{line: 473, col: 26, offset: 15850}, run: (*parser).callonAttrValueDoubleQuoted1, expr: &seqExpr{ - pos: position{line: 460, col: 26, offset: 15475}, + pos: position{line: 473, col: 26, offset: 15850}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 460, col: 26, offset: 15475}, + pos: position{line: 473, col: 26, offset: 15850}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, - &oneOrMoreExpr{ - pos: position{line: 460, col: 31, offset: 15480}, - expr: &charClassMatcher{ - pos: position{line: 460, col: 31, offset: 15480}, - val: "[^\"\\r\\n]", - chars: []rune{'"', '\r', '\n'}, - ignoreCase: false, - inverted: true, + &labeledExpr{ + pos: position{line: 473, col: 31, offset: 15855}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 40, offset: 15864}, + expr: &choiceExpr{ + pos: position{line: 474, col: 5, offset: 15870}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 474, col: 6, offset: 15871}, + run: (*parser).callonAttrValueDoubleQuoted7, + expr: &oneOrMoreExpr{ + pos: position{line: 474, col: 6, offset: 15871}, + expr: &charClassMatcher{ + pos: position{line: 474, col: 6, offset: 15871}, + val: "[^\"\\r\\n\\uFFFD]", + chars: []rune{'"', '\r', '\n', '�'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 476, col: 10, offset: 15953}, + name: "ElementPlaceHolder", + }, + }, + }, }, }, &litMatcher{ - pos: position{line: 460, col: 41, offset: 15490}, + pos: position{line: 476, col: 31, offset: 15974}, val: "\"", ignoreCase: false, want: "\"\\\"\"", @@ -3890,12 +3955,12 @@ var g = &grammar{ }, { name: "AttrValueNone", - pos: position{line: 466, col: 1, offset: 15745}, + pos: position{line: 482, col: 1, offset: 16214}, expr: &actionExpr{ - pos: position{line: 466, col: 18, offset: 15762}, + pos: position{line: 482, col: 18, offset: 16231}, run: (*parser).callonAttrValueNone1, expr: &litMatcher{ - pos: position{line: 466, col: 18, offset: 15762}, + pos: position{line: 482, col: 18, offset: 16231}, val: "None", ignoreCase: false, want: "\"None\"", @@ -3903,741 +3968,152 @@ var g = &grammar{ }, }, { - name: "QuotedString", - pos: position{line: 474, col: 1, offset: 15968}, - expr: &choiceExpr{ - pos: position{line: 474, col: 17, offset: 15984}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 474, col: 17, offset: 15984}, - name: "SingleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 474, col: 38, offset: 16005}, - name: "DoubleQuotedString", - }, - }, - }, - }, - { - name: "SingleQuotedString", - pos: position{line: 476, col: 1, offset: 16025}, + name: "Section", + pos: position{line: 489, col: 1, offset: 16366}, expr: &actionExpr{ - pos: position{line: 476, col: 23, offset: 16047}, - run: (*parser).callonSingleQuotedString1, + pos: position{line: 489, col: 12, offset: 16377}, + run: (*parser).callonSection1, expr: &seqExpr{ - pos: position{line: 476, col: 23, offset: 16047}, + pos: position{line: 489, col: 12, offset: 16377}, exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 476, col: 23, offset: 16047}, - name: "SingleQuoteStringStart", + &labeledExpr{ + pos: position{line: 489, col: 12, offset: 16377}, + label: "attributes", + expr: &zeroOrMoreExpr{ + pos: position{line: 489, col: 23, offset: 16388}, + expr: &ruleRefExpr{ + pos: position{line: 489, col: 24, offset: 16389}, + name: "BlockAttrs", + }, + }, }, &labeledExpr{ - pos: position{line: 476, col: 46, offset: 16070}, - label: "elements", + pos: position{line: 490, col: 5, offset: 16406}, + label: "level", + expr: &actionExpr{ + pos: position{line: 490, col: 12, offset: 16413}, + run: (*parser).callonSection7, + expr: &oneOrMoreExpr{ + pos: position{line: 490, col: 12, offset: 16413}, + expr: &litMatcher{ + pos: position{line: 490, col: 13, offset: 16414}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 494, col: 5, offset: 16505}, + run: (*parser).callonSection10, + }, + &oneOrMoreExpr{ + pos: position{line: 498, col: 5, offset: 16657}, expr: &ruleRefExpr{ - pos: position{line: 476, col: 55, offset: 16079}, - name: "SingleQuotedStringElements", + pos: position{line: 498, col: 5, offset: 16657}, + name: "Space", + }, + }, + &labeledExpr{ + pos: position{line: 498, col: 12, offset: 16664}, + label: "title", + expr: &ruleRefExpr{ + pos: position{line: 498, col: 19, offset: 16671}, + name: "TitleElements", + }, + }, + &labeledExpr{ + pos: position{line: 498, col: 34, offset: 16686}, + label: "id", + expr: &zeroOrMoreExpr{ + pos: position{line: 498, col: 38, offset: 16690}, + expr: &ruleRefExpr{ + pos: position{line: 498, col: 38, offset: 16690}, + name: "InlineElementID", + }, }, }, &ruleRefExpr{ - pos: position{line: 476, col: 82, offset: 16106}, - name: "SingleQuoteStringEnd", + pos: position{line: 498, col: 56, offset: 16708}, + name: "EOL", }, }, }, }, }, { - name: "SingleQuotedStringElements", - pos: position{line: 480, col: 1, offset: 16210}, + name: "TitleElements", + pos: position{line: 502, col: 1, offset: 16814}, expr: &actionExpr{ - pos: position{line: 480, col: 31, offset: 16240}, - run: (*parser).callonSingleQuotedStringElements1, + pos: position{line: 502, col: 18, offset: 16831}, + run: (*parser).callonTitleElements1, expr: &labeledExpr{ - pos: position{line: 480, col: 31, offset: 16240}, + pos: position{line: 502, col: 18, offset: 16831}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 480, col: 41, offset: 16250}, - expr: &ruleRefExpr{ - pos: position{line: 480, col: 41, offset: 16250}, - name: "SingleQuotedStringElement", - }, - }, - }, - }, - }, - { - name: "SingleQuoteStringStart", - pos: position{line: 484, col: 1, offset: 16328}, - expr: &seqExpr{ - pos: position{line: 484, col: 27, offset: 16354}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 484, col: 27, offset: 16354}, - val: "'`", - ignoreCase: false, - want: "\"'`\"", - }, - ¬Expr{ - pos: position{line: 484, col: 32, offset: 16359}, - expr: &charClassMatcher{ - pos: position{line: 484, col: 33, offset: 16360}, - val: "[ \\t\\r\\n]", - chars: []rune{' ', '\t', '\r', '\n'}, - ignoreCase: false, - inverted: false, + pos: position{line: 502, col: 27, offset: 16840}, + expr: &seqExpr{ + pos: position{line: 502, col: 28, offset: 16841}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 502, col: 28, offset: 16841}, + expr: &ruleRefExpr{ + pos: position{line: 502, col: 29, offset: 16842}, + name: "Newline", + }, + }, + ¬Expr{ + pos: position{line: 502, col: 37, offset: 16850}, + expr: &ruleRefExpr{ + pos: position{line: 502, col: 38, offset: 16851}, + name: "InlineElementID", + }, + }, + &ruleRefExpr{ + pos: position{line: 502, col: 54, offset: 16867}, + name: "TitleElement", + }, + }, }, }, }, }, }, { - name: "SingleQuoteStringEnd", - pos: position{line: 486, col: 1, offset: 16371}, - expr: &litMatcher{ - pos: position{line: 486, col: 25, offset: 16395}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - { - name: "SingleQuotedStringElement", - pos: position{line: 489, col: 1, offset: 16483}, + name: "TitleElement", + pos: position{line: 506, col: 1, offset: 16988}, expr: &actionExpr{ - pos: position{line: 489, col: 30, offset: 16512}, - run: (*parser).callonSingleQuotedStringElement1, + pos: position{line: 506, col: 17, offset: 17004}, + run: (*parser).callonTitleElement1, expr: &labeledExpr{ - pos: position{line: 489, col: 30, offset: 16512}, + pos: position{line: 506, col: 17, offset: 17004}, label: "element", expr: &choiceExpr{ - pos: position{line: 490, col: 9, offset: 16530}, + pos: position{line: 506, col: 26, offset: 17013}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 490, col: 9, offset: 16530}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 490, col: 9, offset: 16530}, - name: "LineBreak", - }, - ¬Expr{ - pos: position{line: 490, col: 19, offset: 16540}, - expr: &ruleRefExpr{ - pos: position{line: 490, col: 20, offset: 16541}, - name: "SingleQuoteStringEnd", - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 491, col: 11, offset: 16597}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 491, col: 11, offset: 16597}, - expr: &ruleRefExpr{ - pos: position{line: 491, col: 11, offset: 16597}, - name: "Space", - }, - }, - ¬Expr{ - pos: position{line: 491, col: 18, offset: 16604}, - expr: &ruleRefExpr{ - pos: position{line: 491, col: 19, offset: 16605}, - name: "SingleQuoteStringEnd", - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 492, col: 11, offset: 16636}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 492, col: 11, offset: 16636}, - expr: &litMatcher{ - pos: position{line: 492, col: 12, offset: 16637}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 492, col: 16, offset: 16641}, - name: "Symbol", - }, - }, - }, &ruleRefExpr{ - pos: position{line: 493, col: 11, offset: 16689}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 494, col: 11, offset: 16710}, - name: "InlineImage", + pos: position{line: 506, col: 26, offset: 17013}, + name: "Word", }, &ruleRefExpr{ - pos: position{line: 495, col: 11, offset: 16732}, - name: "InlineFootnote", + pos: position{line: 507, col: 11, offset: 17028}, + name: "LineBreak", }, - &ruleRefExpr{ - pos: position{line: 496, col: 11, offset: 16757}, - name: "InlinePassthrough", + &oneOrMoreExpr{ + pos: position{line: 508, col: 11, offset: 17073}, + expr: &ruleRefExpr{ + pos: position{line: 508, col: 11, offset: 17073}, + name: "Space", + }, }, &ruleRefExpr{ - pos: position{line: 497, col: 11, offset: 16846}, - name: "Link", + pos: position{line: 521, col: 11, offset: 17492}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 498, col: 11, offset: 16861}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 499, col: 11, offset: 16893}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 500, col: 11, offset: 16912}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 501, col: 11, offset: 16933}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 502, col: 11, offset: 16954}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 503, col: 11, offset: 16978}, - name: "SuperscriptText", - }, - &seqExpr{ - pos: position{line: 504, col: 11, offset: 17004}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 504, col: 11, offset: 17004}, - expr: &litMatcher{ - pos: position{line: 504, col: 12, offset: 17005}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 504, col: 17, offset: 17010}, - name: "MonospaceText", - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 505, col: 11, offset: 17034}, - name: "DoubleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 506, col: 11, offset: 17063}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 507, col: 11, offset: 17091}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 508, col: 11, offset: 17118}, - name: "SingleQuotedStringFallbackCharacter", - }, - }, - }, - }, - }, - }, - { - name: "SingleQuotedStringFallbackCharacter", - pos: position{line: 512, col: 1, offset: 17184}, - expr: &choiceExpr{ - pos: position{line: 512, col: 41, offset: 17224}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 512, col: 41, offset: 17224}, - val: "[^\\r\\n\\t `]", - chars: []rune{'\r', '\n', '\t', ' ', '`'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 512, col: 55, offset: 17238}, - run: (*parser).callonSingleQuotedStringFallbackCharacter3, - expr: &seqExpr{ - pos: position{line: 512, col: 55, offset: 17238}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 512, col: 55, offset: 17238}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 512, col: 59, offset: 17242}, - expr: &litMatcher{ - pos: position{line: 512, col: 60, offset: 17243}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "DoubleQuotedString", - pos: position{line: 516, col: 1, offset: 17302}, - expr: &actionExpr{ - pos: position{line: 516, col: 23, offset: 17324}, - run: (*parser).callonDoubleQuotedString1, - expr: &seqExpr{ - pos: position{line: 516, col: 23, offset: 17324}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 516, col: 23, offset: 17324}, - name: "DoubleQuoteStringStart", - }, - &labeledExpr{ - pos: position{line: 516, col: 46, offset: 17347}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 516, col: 55, offset: 17356}, - name: "DoubleQuotedStringElements", - }, - }, - &ruleRefExpr{ - pos: position{line: 516, col: 82, offset: 17383}, - name: "DoubleQuoteStringEnd", - }, - }, - }, - }, - }, - { - name: "DoubleQuotedStringElements", - pos: position{line: 520, col: 1, offset: 17487}, - expr: &actionExpr{ - pos: position{line: 520, col: 31, offset: 17517}, - run: (*parser).callonDoubleQuotedStringElements1, - expr: &labeledExpr{ - pos: position{line: 520, col: 31, offset: 17517}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 520, col: 41, offset: 17527}, - expr: &ruleRefExpr{ - pos: position{line: 520, col: 41, offset: 17527}, - name: "DoubleQuotedStringElement", - }, - }, - }, - }, - }, - { - name: "DoubleQuotedStringElement", - pos: position{line: 525, col: 1, offset: 17687}, - expr: &actionExpr{ - pos: position{line: 525, col: 30, offset: 17716}, - run: (*parser).callonDoubleQuotedStringElement1, - expr: &labeledExpr{ - pos: position{line: 525, col: 30, offset: 17716}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 526, col: 9, offset: 17734}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 526, col: 9, offset: 17734}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 526, col: 9, offset: 17734}, - name: "LineBreak", - }, - ¬Expr{ - pos: position{line: 526, col: 19, offset: 17744}, - expr: &ruleRefExpr{ - pos: position{line: 526, col: 20, offset: 17745}, - name: "DoubleQuoteStringEnd", - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 527, col: 11, offset: 17801}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 527, col: 11, offset: 17801}, - expr: &ruleRefExpr{ - pos: position{line: 527, col: 11, offset: 17801}, - name: "Space", - }, - }, - ¬Expr{ - pos: position{line: 527, col: 18, offset: 17808}, - expr: &ruleRefExpr{ - pos: position{line: 527, col: 19, offset: 17809}, - name: "DoubleQuoteStringEnd", - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 528, col: 11, offset: 17840}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 529, col: 11, offset: 17861}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 530, col: 11, offset: 17883}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 531, col: 11, offset: 17908}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 532, col: 11, offset: 17997}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 533, col: 11, offset: 18014}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 534, col: 11, offset: 18041}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 535, col: 11, offset: 18056}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 536, col: 11, offset: 18088}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 537, col: 11, offset: 18107}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 538, col: 11, offset: 18128}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 539, col: 11, offset: 18149}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 540, col: 11, offset: 18173}, - name: "SuperscriptText", - }, - &seqExpr{ - pos: position{line: 541, col: 11, offset: 18199}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 541, col: 11, offset: 18199}, - expr: &litMatcher{ - pos: position{line: 541, col: 12, offset: 18200}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 541, col: 18, offset: 18206}, - name: "MonospaceText", - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 542, col: 11, offset: 18230}, - name: "SingleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 543, col: 11, offset: 18259}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 544, col: 11, offset: 18287}, - name: "DoubleQuotedStringFallbackCharacter", - }, - }, - }, - }, - }, - }, - { - name: "DoubleQuoteStringStart", - pos: position{line: 548, col: 1, offset: 18361}, - expr: &seqExpr{ - pos: position{line: 548, col: 27, offset: 18387}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 548, col: 27, offset: 18387}, - val: "\"`", - ignoreCase: false, - want: "\"\\\"`\"", - }, - ¬Expr{ - pos: position{line: 548, col: 33, offset: 18393}, - expr: &charClassMatcher{ - pos: position{line: 548, col: 34, offset: 18394}, - val: "[ \\t\\r\\n]", - chars: []rune{' ', '\t', '\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - { - name: "DoubleQuoteStringEnd", - pos: position{line: 550, col: 1, offset: 18405}, - expr: &litMatcher{ - pos: position{line: 550, col: 25, offset: 18429}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, - { - name: "DoubleQuotedStringFallbackCharacter", - pos: position{line: 552, col: 1, offset: 18436}, - expr: &actionExpr{ - pos: position{line: 552, col: 41, offset: 18476}, - run: (*parser).callonDoubleQuotedStringFallbackCharacter1, - expr: &choiceExpr{ - pos: position{line: 552, col: 42, offset: 18477}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 552, col: 42, offset: 18477}, - val: "[^\\r\\n\\t `]", - chars: []rune{'\r', '\n', '\t', ' ', '`'}, - ignoreCase: false, - inverted: true, - }, - &seqExpr{ - pos: position{line: 552, col: 56, offset: 18491}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 552, col: 56, offset: 18491}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 552, col: 60, offset: 18495}, - expr: &litMatcher{ - pos: position{line: 552, col: 61, offset: 18496}, - val: "\"", - ignoreCase: false, - want: "\"\\\"\"", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "Section", - pos: position{line: 559, col: 1, offset: 18661}, - expr: &actionExpr{ - pos: position{line: 559, col: 12, offset: 18672}, - run: (*parser).callonSection1, - expr: &seqExpr{ - pos: position{line: 559, col: 12, offset: 18672}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 559, col: 12, offset: 18672}, - label: "attributes", - expr: &zeroOrMoreExpr{ - pos: position{line: 559, col: 23, offset: 18683}, - expr: &ruleRefExpr{ - pos: position{line: 559, col: 24, offset: 18684}, - name: "BlockAttrs", - }, - }, - }, - &labeledExpr{ - pos: position{line: 560, col: 5, offset: 18701}, - label: "level", - expr: &actionExpr{ - pos: position{line: 560, col: 12, offset: 18708}, - run: (*parser).callonSection7, - expr: &oneOrMoreExpr{ - pos: position{line: 560, col: 12, offset: 18708}, - expr: &litMatcher{ - pos: position{line: 560, col: 13, offset: 18709}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 564, col: 5, offset: 18800}, - run: (*parser).callonSection10, - }, - &oneOrMoreExpr{ - pos: position{line: 568, col: 5, offset: 18952}, - expr: &ruleRefExpr{ - pos: position{line: 568, col: 5, offset: 18952}, - name: "Space", - }, - }, - &labeledExpr{ - pos: position{line: 568, col: 12, offset: 18959}, - label: "title", - expr: &ruleRefExpr{ - pos: position{line: 568, col: 19, offset: 18966}, - name: "TitleElements", - }, - }, - &labeledExpr{ - pos: position{line: 568, col: 34, offset: 18981}, - label: "id", - expr: &zeroOrMoreExpr{ - pos: position{line: 568, col: 38, offset: 18985}, - expr: &ruleRefExpr{ - pos: position{line: 568, col: 38, offset: 18985}, - name: "InlineElementID", - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 568, col: 56, offset: 19003}, - name: "EOL", - }, - }, - }, - }, - }, - { - name: "TitleElements", - pos: position{line: 572, col: 1, offset: 19109}, - expr: &actionExpr{ - pos: position{line: 572, col: 18, offset: 19126}, - run: (*parser).callonTitleElements1, - expr: &labeledExpr{ - pos: position{line: 572, col: 18, offset: 19126}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 572, col: 27, offset: 19135}, - expr: &seqExpr{ - pos: position{line: 572, col: 28, offset: 19136}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 572, col: 28, offset: 19136}, - expr: &ruleRefExpr{ - pos: position{line: 572, col: 29, offset: 19137}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 572, col: 37, offset: 19145}, - expr: &ruleRefExpr{ - pos: position{line: 572, col: 38, offset: 19146}, - name: "InlineElementID", - }, - }, - &ruleRefExpr{ - pos: position{line: 572, col: 54, offset: 19162}, - name: "TitleElement", - }, - }, - }, - }, - }, - }, - }, - { - name: "TitleElement", - pos: position{line: 576, col: 1, offset: 19283}, - expr: &actionExpr{ - pos: position{line: 576, col: 17, offset: 19299}, - run: (*parser).callonTitleElement1, - expr: &labeledExpr{ - pos: position{line: 576, col: 17, offset: 19299}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 576, col: 26, offset: 19308}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 576, col: 26, offset: 19308}, - name: "Word", - }, - &ruleRefExpr{ - pos: position{line: 577, col: 11, offset: 19323}, - name: "LineBreak", - }, - &oneOrMoreExpr{ - pos: position{line: 578, col: 11, offset: 19368}, - expr: &ruleRefExpr{ - pos: position{line: 578, col: 11, offset: 19368}, - name: "Space", - }, - }, - &ruleRefExpr{ - pos: position{line: 579, col: 11, offset: 19386}, - name: "CrossReference", - }, - &ruleRefExpr{ - pos: position{line: 580, col: 11, offset: 19455}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 581, col: 11, offset: 19544}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 582, col: 11, offset: 19565}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 583, col: 11, offset: 19587}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 584, col: 11, offset: 19602}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 585, col: 11, offset: 19627}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 586, col: 11, offset: 19650}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 587, col: 11, offset: 19671}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 588, col: 11, offset: 19698}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 589, col: 11, offset: 19715}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 590, col: 11, offset: 19747}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 591, col: 11, offset: 19775}, - name: "AnyChar", + pos: position{line: 522, col: 11, offset: 17521}, + name: "AnyChar", }, }, }, @@ -4646,18 +4122,18 @@ var g = &grammar{ }, { name: "TableOfContentsPlaceHolder", - pos: position{line: 598, col: 1, offset: 19926}, + pos: position{line: 529, col: 1, offset: 17672}, expr: &seqExpr{ - pos: position{line: 598, col: 31, offset: 19956}, + pos: position{line: 529, col: 31, offset: 17702}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 598, col: 31, offset: 19956}, + pos: position{line: 529, col: 31, offset: 17702}, val: "toc::[]", ignoreCase: false, want: "\"toc::[]\"", }, &ruleRefExpr{ - pos: position{line: 598, col: 41, offset: 19966}, + pos: position{line: 529, col: 41, offset: 17712}, name: "EOL", }, }, @@ -4665,40 +4141,40 @@ var g = &grammar{ }, { name: "UserMacroBlock", - pos: position{line: 603, col: 1, offset: 20077}, + pos: position{line: 534, col: 1, offset: 17823}, expr: &actionExpr{ - pos: position{line: 603, col: 19, offset: 20095}, + pos: position{line: 534, col: 19, offset: 17841}, run: (*parser).callonUserMacroBlock1, expr: &seqExpr{ - pos: position{line: 603, col: 19, offset: 20095}, + pos: position{line: 534, col: 19, offset: 17841}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 603, col: 19, offset: 20095}, + pos: position{line: 534, col: 19, offset: 17841}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 603, col: 25, offset: 20101}, + pos: position{line: 534, col: 25, offset: 17847}, name: "UserMacroName", }, }, &litMatcher{ - pos: position{line: 603, col: 40, offset: 20116}, + pos: position{line: 534, col: 40, offset: 17862}, val: "::", ignoreCase: false, want: "\"::\"", }, &labeledExpr{ - pos: position{line: 603, col: 45, offset: 20121}, + pos: position{line: 534, col: 45, offset: 17867}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 603, col: 52, offset: 20128}, + pos: position{line: 534, col: 52, offset: 17874}, name: "UserMacroValue", }, }, &labeledExpr{ - pos: position{line: 603, col: 68, offset: 20144}, + pos: position{line: 534, col: 68, offset: 17890}, label: "attrs", expr: &ruleRefExpr{ - pos: position{line: 603, col: 75, offset: 20151}, + pos: position{line: 534, col: 75, offset: 17897}, name: "UserMacroAttributes", }, }, @@ -4708,40 +4184,40 @@ var g = &grammar{ }, { name: "InlineUserMacro", - pos: position{line: 607, col: 1, offset: 20266}, + pos: position{line: 538, col: 1, offset: 18012}, expr: &actionExpr{ - pos: position{line: 607, col: 20, offset: 20285}, + pos: position{line: 538, col: 20, offset: 18031}, run: (*parser).callonInlineUserMacro1, expr: &seqExpr{ - pos: position{line: 607, col: 20, offset: 20285}, + pos: position{line: 538, col: 20, offset: 18031}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 607, col: 20, offset: 20285}, + pos: position{line: 538, col: 20, offset: 18031}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 607, col: 26, offset: 20291}, + pos: position{line: 538, col: 26, offset: 18037}, name: "UserMacroName", }, }, &litMatcher{ - pos: position{line: 607, col: 41, offset: 20306}, + pos: position{line: 538, col: 41, offset: 18052}, val: ":", ignoreCase: false, want: "\":\"", }, &labeledExpr{ - pos: position{line: 607, col: 45, offset: 20310}, + pos: position{line: 538, col: 45, offset: 18056}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 607, col: 52, offset: 20317}, + pos: position{line: 538, col: 52, offset: 18063}, name: "UserMacroValue", }, }, &labeledExpr{ - pos: position{line: 607, col: 68, offset: 20333}, + pos: position{line: 538, col: 68, offset: 18079}, label: "attrs", expr: &ruleRefExpr{ - pos: position{line: 607, col: 75, offset: 20340}, + pos: position{line: 538, col: 75, offset: 18086}, name: "UserMacroAttributes", }, }, @@ -4751,14 +4227,14 @@ var g = &grammar{ }, { name: "UserMacroName", - pos: position{line: 611, col: 1, offset: 20456}, + pos: position{line: 542, col: 1, offset: 18202}, expr: &actionExpr{ - pos: position{line: 611, col: 18, offset: 20473}, + pos: position{line: 542, col: 18, offset: 18219}, run: (*parser).callonUserMacroName1, expr: &oneOrMoreExpr{ - pos: position{line: 611, col: 19, offset: 20474}, + pos: position{line: 542, col: 19, offset: 18220}, expr: &charClassMatcher{ - pos: position{line: 611, col: 19, offset: 20474}, + pos: position{line: 542, col: 19, offset: 18220}, val: "[\\pL0-9_-]", chars: []rune{'_', '-'}, ranges: []rune{'0', '9'}, @@ -4771,14 +4247,14 @@ var g = &grammar{ }, { name: "UserMacroValue", - pos: position{line: 615, col: 1, offset: 20523}, + pos: position{line: 546, col: 1, offset: 18269}, expr: &actionExpr{ - pos: position{line: 615, col: 19, offset: 20541}, + pos: position{line: 546, col: 19, offset: 18287}, run: (*parser).callonUserMacroValue1, expr: &zeroOrMoreExpr{ - pos: position{line: 615, col: 19, offset: 20541}, + pos: position{line: 546, col: 19, offset: 18287}, expr: &charClassMatcher{ - pos: position{line: 615, col: 19, offset: 20541}, + pos: position{line: 546, col: 19, offset: 18287}, val: "[^:[ \\r\\n]", chars: []rune{':', '[', ' ', '\r', '\n'}, ignoreCase: false, @@ -4789,32 +4265,32 @@ var g = &grammar{ }, { name: "UserMacroAttributes", - pos: position{line: 619, col: 1, offset: 20589}, + pos: position{line: 550, col: 1, offset: 18335}, expr: &actionExpr{ - pos: position{line: 619, col: 24, offset: 20612}, + pos: position{line: 550, col: 24, offset: 18358}, run: (*parser).callonUserMacroAttributes1, expr: &seqExpr{ - pos: position{line: 619, col: 24, offset: 20612}, + pos: position{line: 550, col: 24, offset: 18358}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 619, col: 24, offset: 20612}, + pos: position{line: 550, col: 24, offset: 18358}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 619, col: 28, offset: 20616}, + pos: position{line: 550, col: 28, offset: 18362}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 619, col: 34, offset: 20622}, + pos: position{line: 550, col: 34, offset: 18368}, expr: &ruleRefExpr{ - pos: position{line: 619, col: 35, offset: 20623}, + pos: position{line: 550, col: 35, offset: 18369}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 619, col: 54, offset: 20642}, + pos: position{line: 550, col: 54, offset: 18388}, val: "]", ignoreCase: false, want: "\"]\"", @@ -4825,41 +4301,41 @@ var g = &grammar{ }, { name: "FileInclusion", - pos: position{line: 626, col: 1, offset: 20824}, + pos: position{line: 557, col: 1, offset: 18570}, expr: &actionExpr{ - pos: position{line: 626, col: 18, offset: 20841}, + pos: position{line: 557, col: 18, offset: 18587}, run: (*parser).callonFileInclusion1, expr: &seqExpr{ - pos: position{line: 626, col: 18, offset: 20841}, + pos: position{line: 557, col: 18, offset: 18587}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 626, col: 18, offset: 20841}, + pos: position{line: 557, col: 18, offset: 18587}, label: "incl", expr: &actionExpr{ - pos: position{line: 626, col: 24, offset: 20847}, + pos: position{line: 557, col: 24, offset: 18593}, run: (*parser).callonFileInclusion4, expr: &seqExpr{ - pos: position{line: 626, col: 24, offset: 20847}, + pos: position{line: 557, col: 24, offset: 18593}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 626, col: 24, offset: 20847}, + pos: position{line: 557, col: 24, offset: 18593}, val: "include::", ignoreCase: false, want: "\"include::\"", }, &labeledExpr{ - pos: position{line: 626, col: 36, offset: 20859}, + pos: position{line: 557, col: 36, offset: 18605}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 626, col: 42, offset: 20865}, + pos: position{line: 557, col: 42, offset: 18611}, name: "FileLocation", }, }, &labeledExpr{ - pos: position{line: 626, col: 56, offset: 20879}, + pos: position{line: 557, col: 56, offset: 18625}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 626, col: 74, offset: 20897}, + pos: position{line: 557, col: 74, offset: 18643}, name: "FileIncludeAttributes", }, }, @@ -4868,14 +4344,14 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 628, col: 8, offset: 21044}, + pos: position{line: 559, col: 8, offset: 18790}, expr: &ruleRefExpr{ - pos: position{line: 628, col: 8, offset: 21044}, + pos: position{line: 559, col: 8, offset: 18790}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 628, col: 15, offset: 21051}, + pos: position{line: 559, col: 15, offset: 18797}, name: "EOL", }, }, @@ -4884,37 +4360,37 @@ var g = &grammar{ }, { name: "FileIncludeAttributes", - pos: position{line: 632, col: 1, offset: 21103}, + pos: position{line: 563, col: 1, offset: 18849}, expr: &actionExpr{ - pos: position{line: 632, col: 26, offset: 21128}, + pos: position{line: 563, col: 26, offset: 18874}, run: (*parser).callonFileIncludeAttributes1, expr: &seqExpr{ - pos: position{line: 632, col: 26, offset: 21128}, + pos: position{line: 563, col: 26, offset: 18874}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 632, col: 26, offset: 21128}, + pos: position{line: 563, col: 26, offset: 18874}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 632, col: 30, offset: 21132}, + pos: position{line: 563, col: 30, offset: 18878}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 632, col: 36, offset: 21138}, + pos: position{line: 563, col: 36, offset: 18884}, expr: &choiceExpr{ - pos: position{line: 632, col: 37, offset: 21139}, + pos: position{line: 563, col: 37, offset: 18885}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 632, col: 37, offset: 21139}, + pos: position{line: 563, col: 37, offset: 18885}, name: "LineRangesAttribute", }, &ruleRefExpr{ - pos: position{line: 632, col: 59, offset: 21161}, + pos: position{line: 563, col: 59, offset: 18907}, name: "TagRangesAttribute", }, &ruleRefExpr{ - pos: position{line: 632, col: 80, offset: 21182}, + pos: position{line: 563, col: 80, offset: 18928}, name: "GenericAttribute", }, }, @@ -4922,7 +4398,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 632, col: 99, offset: 21201}, + pos: position{line: 563, col: 99, offset: 18947}, val: "]", ignoreCase: false, want: "\"]\"", @@ -4933,31 +4409,31 @@ var g = &grammar{ }, { name: "LineRangesAttribute", - pos: position{line: 636, col: 1, offset: 21273}, + pos: position{line: 567, col: 1, offset: 19019}, expr: &actionExpr{ - pos: position{line: 636, col: 24, offset: 21296}, + pos: position{line: 567, col: 24, offset: 19042}, run: (*parser).callonLineRangesAttribute1, expr: &seqExpr{ - pos: position{line: 636, col: 24, offset: 21296}, + pos: position{line: 567, col: 24, offset: 19042}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 636, col: 24, offset: 21296}, + pos: position{line: 567, col: 24, offset: 19042}, val: "lines=", ignoreCase: false, want: "\"lines=\"", }, &labeledExpr{ - pos: position{line: 636, col: 33, offset: 21305}, + pos: position{line: 567, col: 33, offset: 19051}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 636, col: 40, offset: 21312}, + pos: position{line: 567, col: 40, offset: 19058}, name: "LineRangesAttributeValue", }, }, &zeroOrOneExpr{ - pos: position{line: 636, col: 66, offset: 21338}, + pos: position{line: 567, col: 66, offset: 19084}, expr: &litMatcher{ - pos: position{line: 636, col: 66, offset: 21338}, + pos: position{line: 567, col: 66, offset: 19084}, val: ",", ignoreCase: false, want: "\",\"", @@ -4969,73 +4445,73 @@ var g = &grammar{ }, { name: "LineRangesAttributeValue", - pos: position{line: 640, col: 1, offset: 21397}, + pos: position{line: 571, col: 1, offset: 19143}, expr: &actionExpr{ - pos: position{line: 640, col: 29, offset: 21425}, + pos: position{line: 571, col: 29, offset: 19171}, run: (*parser).callonLineRangesAttributeValue1, expr: &seqExpr{ - pos: position{line: 640, col: 29, offset: 21425}, + pos: position{line: 571, col: 29, offset: 19171}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 640, col: 29, offset: 21425}, + pos: position{line: 571, col: 29, offset: 19171}, label: "value", expr: &choiceExpr{ - pos: position{line: 640, col: 36, offset: 21432}, + pos: position{line: 571, col: 36, offset: 19178}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 640, col: 36, offset: 21432}, + pos: position{line: 571, col: 36, offset: 19178}, name: "MultipleLineRanges", }, &ruleRefExpr{ - pos: position{line: 641, col: 11, offset: 21549}, + pos: position{line: 572, col: 11, offset: 19295}, name: "MultipleQuotedLineRanges", }, &ruleRefExpr{ - pos: position{line: 642, col: 11, offset: 21585}, + pos: position{line: 573, col: 11, offset: 19331}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 643, col: 11, offset: 21611}, + pos: position{line: 574, col: 11, offset: 19357}, name: "MultiLineQuotedRange", }, &ruleRefExpr{ - pos: position{line: 644, col: 11, offset: 21643}, + pos: position{line: 575, col: 11, offset: 19389}, name: "SingleLineQuotedRange", }, &ruleRefExpr{ - pos: position{line: 645, col: 11, offset: 21675}, + pos: position{line: 576, col: 11, offset: 19421}, name: "SingleLineRange", }, &ruleRefExpr{ - pos: position{line: 646, col: 11, offset: 21702}, + pos: position{line: 577, col: 11, offset: 19448}, name: "UndefinedLineRange", }, }, }, }, &zeroOrMoreExpr{ - pos: position{line: 646, col: 31, offset: 21722}, + pos: position{line: 577, col: 31, offset: 19468}, expr: &ruleRefExpr{ - pos: position{line: 646, col: 31, offset: 21722}, + pos: position{line: 577, col: 31, offset: 19468}, name: "Space", }, }, &choiceExpr{ - pos: position{line: 646, col: 39, offset: 21730}, + pos: position{line: 577, col: 39, offset: 19476}, alternatives: []interface{}{ &andExpr{ - pos: position{line: 646, col: 39, offset: 21730}, + pos: position{line: 577, col: 39, offset: 19476}, expr: &litMatcher{ - pos: position{line: 646, col: 40, offset: 21731}, + pos: position{line: 577, col: 40, offset: 19477}, val: ",", ignoreCase: false, want: "\",\"", }, }, &andExpr{ - pos: position{line: 646, col: 46, offset: 21737}, + pos: position{line: 577, col: 46, offset: 19483}, expr: &litMatcher{ - pos: position{line: 646, col: 47, offset: 21738}, + pos: position{line: 577, col: 47, offset: 19484}, val: "]", ignoreCase: false, want: "\"]\"", @@ -5049,59 +4525,59 @@ var g = &grammar{ }, { name: "MultipleLineRanges", - pos: position{line: 650, col: 1, offset: 21770}, + pos: position{line: 581, col: 1, offset: 19516}, expr: &actionExpr{ - pos: position{line: 650, col: 23, offset: 21792}, + pos: position{line: 581, col: 23, offset: 19538}, run: (*parser).callonMultipleLineRanges1, expr: &seqExpr{ - pos: position{line: 650, col: 23, offset: 21792}, + pos: position{line: 581, col: 23, offset: 19538}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 650, col: 23, offset: 21792}, + pos: position{line: 581, col: 23, offset: 19538}, label: "first", expr: &choiceExpr{ - pos: position{line: 650, col: 30, offset: 21799}, + pos: position{line: 581, col: 30, offset: 19545}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 650, col: 30, offset: 21799}, + pos: position{line: 581, col: 30, offset: 19545}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 650, col: 47, offset: 21816}, + pos: position{line: 581, col: 47, offset: 19562}, name: "SingleLineRange", }, }, }, }, &labeledExpr{ - pos: position{line: 651, col: 5, offset: 21838}, + pos: position{line: 582, col: 5, offset: 19584}, label: "others", expr: &oneOrMoreExpr{ - pos: position{line: 651, col: 12, offset: 21845}, + pos: position{line: 582, col: 12, offset: 19591}, expr: &actionExpr{ - pos: position{line: 651, col: 13, offset: 21846}, + pos: position{line: 582, col: 13, offset: 19592}, run: (*parser).callonMultipleLineRanges9, expr: &seqExpr{ - pos: position{line: 651, col: 13, offset: 21846}, + pos: position{line: 582, col: 13, offset: 19592}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 651, col: 13, offset: 21846}, + pos: position{line: 582, col: 13, offset: 19592}, val: ";", ignoreCase: false, want: "\";\"", }, &labeledExpr{ - pos: position{line: 651, col: 17, offset: 21850}, + pos: position{line: 582, col: 17, offset: 19596}, label: "other", expr: &choiceExpr{ - pos: position{line: 651, col: 24, offset: 21857}, + pos: position{line: 582, col: 24, offset: 19603}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 651, col: 24, offset: 21857}, + pos: position{line: 582, col: 24, offset: 19603}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 651, col: 41, offset: 21874}, + pos: position{line: 582, col: 41, offset: 19620}, name: "SingleLineRange", }, }, @@ -5118,65 +4594,65 @@ var g = &grammar{ }, { name: "MultipleQuotedLineRanges", - pos: position{line: 657, col: 1, offset: 22012}, + pos: position{line: 588, col: 1, offset: 19758}, expr: &actionExpr{ - pos: position{line: 657, col: 29, offset: 22040}, + pos: position{line: 588, col: 29, offset: 19786}, run: (*parser).callonMultipleQuotedLineRanges1, expr: &seqExpr{ - pos: position{line: 657, col: 29, offset: 22040}, + pos: position{line: 588, col: 29, offset: 19786}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 657, col: 29, offset: 22040}, + pos: position{line: 588, col: 29, offset: 19786}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 657, col: 34, offset: 22045}, + pos: position{line: 588, col: 34, offset: 19791}, label: "first", expr: &choiceExpr{ - pos: position{line: 657, col: 41, offset: 22052}, + pos: position{line: 588, col: 41, offset: 19798}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 657, col: 41, offset: 22052}, + pos: position{line: 588, col: 41, offset: 19798}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 657, col: 58, offset: 22069}, + pos: position{line: 588, col: 58, offset: 19815}, name: "SingleLineRange", }, }, }, }, &labeledExpr{ - pos: position{line: 658, col: 5, offset: 22091}, + pos: position{line: 589, col: 5, offset: 19837}, label: "others", expr: &oneOrMoreExpr{ - pos: position{line: 658, col: 12, offset: 22098}, + pos: position{line: 589, col: 12, offset: 19844}, expr: &actionExpr{ - pos: position{line: 658, col: 13, offset: 22099}, + pos: position{line: 589, col: 13, offset: 19845}, run: (*parser).callonMultipleQuotedLineRanges10, expr: &seqExpr{ - pos: position{line: 658, col: 13, offset: 22099}, + pos: position{line: 589, col: 13, offset: 19845}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 658, col: 13, offset: 22099}, + pos: position{line: 589, col: 13, offset: 19845}, val: ",", ignoreCase: false, want: "\",\"", }, &labeledExpr{ - pos: position{line: 658, col: 17, offset: 22103}, + pos: position{line: 589, col: 17, offset: 19849}, label: "other", expr: &choiceExpr{ - pos: position{line: 658, col: 24, offset: 22110}, + pos: position{line: 589, col: 24, offset: 19856}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 658, col: 24, offset: 22110}, + pos: position{line: 589, col: 24, offset: 19856}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 658, col: 41, offset: 22127}, + pos: position{line: 589, col: 41, offset: 19873}, name: "SingleLineRange", }, }, @@ -5188,7 +4664,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 660, col: 9, offset: 22180}, + pos: position{line: 591, col: 9, offset: 19926}, val: "\"", ignoreCase: false, want: "\"\\\"\"", @@ -5199,32 +4675,32 @@ var g = &grammar{ }, { name: "MultiLineRange", - pos: position{line: 664, col: 1, offset: 22270}, + pos: position{line: 595, col: 1, offset: 20016}, expr: &actionExpr{ - pos: position{line: 664, col: 19, offset: 22288}, + pos: position{line: 595, col: 19, offset: 20034}, run: (*parser).callonMultiLineRange1, expr: &seqExpr{ - pos: position{line: 664, col: 19, offset: 22288}, + pos: position{line: 595, col: 19, offset: 20034}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 664, col: 19, offset: 22288}, + pos: position{line: 595, col: 19, offset: 20034}, label: "start", expr: &ruleRefExpr{ - pos: position{line: 664, col: 26, offset: 22295}, + pos: position{line: 595, col: 26, offset: 20041}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 664, col: 34, offset: 22303}, + pos: position{line: 595, col: 34, offset: 20049}, val: "..", ignoreCase: false, want: "\"..\"", }, &labeledExpr{ - pos: position{line: 664, col: 39, offset: 22308}, + pos: position{line: 595, col: 39, offset: 20054}, label: "end", expr: &ruleRefExpr{ - pos: position{line: 664, col: 44, offset: 22313}, + pos: position{line: 595, col: 44, offset: 20059}, name: "NUMBER", }, }, @@ -5234,43 +4710,43 @@ var g = &grammar{ }, { name: "MultiLineQuotedRange", - pos: position{line: 668, col: 1, offset: 22401}, + pos: position{line: 599, col: 1, offset: 20147}, expr: &actionExpr{ - pos: position{line: 668, col: 25, offset: 22425}, + pos: position{line: 599, col: 25, offset: 20171}, run: (*parser).callonMultiLineQuotedRange1, expr: &seqExpr{ - pos: position{line: 668, col: 25, offset: 22425}, + pos: position{line: 599, col: 25, offset: 20171}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 668, col: 25, offset: 22425}, + pos: position{line: 599, col: 25, offset: 20171}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 668, col: 30, offset: 22430}, + pos: position{line: 599, col: 30, offset: 20176}, label: "start", expr: &ruleRefExpr{ - pos: position{line: 668, col: 37, offset: 22437}, + pos: position{line: 599, col: 37, offset: 20183}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 668, col: 45, offset: 22445}, + pos: position{line: 599, col: 45, offset: 20191}, val: "..", ignoreCase: false, want: "\"..\"", }, &labeledExpr{ - pos: position{line: 668, col: 50, offset: 22450}, + pos: position{line: 599, col: 50, offset: 20196}, label: "end", expr: &ruleRefExpr{ - pos: position{line: 668, col: 55, offset: 22455}, + pos: position{line: 599, col: 55, offset: 20201}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 668, col: 63, offset: 22463}, + pos: position{line: 599, col: 63, offset: 20209}, val: "\"", ignoreCase: false, want: "\"\\\"\"", @@ -5281,15 +4757,15 @@ var g = &grammar{ }, { name: "SingleLineRange", - pos: position{line: 672, col: 1, offset: 22548}, + pos: position{line: 603, col: 1, offset: 20294}, expr: &actionExpr{ - pos: position{line: 672, col: 20, offset: 22567}, + pos: position{line: 603, col: 20, offset: 20313}, run: (*parser).callonSingleLineRange1, expr: &labeledExpr{ - pos: position{line: 672, col: 20, offset: 22567}, + pos: position{line: 603, col: 20, offset: 20313}, label: "singleline", expr: &ruleRefExpr{ - pos: position{line: 672, col: 32, offset: 22579}, + pos: position{line: 603, col: 32, offset: 20325}, name: "NUMBER", }, }, @@ -5297,29 +4773,29 @@ var g = &grammar{ }, { name: "SingleLineQuotedRange", - pos: position{line: 676, col: 1, offset: 22674}, + pos: position{line: 607, col: 1, offset: 20420}, expr: &actionExpr{ - pos: position{line: 676, col: 26, offset: 22699}, + pos: position{line: 607, col: 26, offset: 20445}, run: (*parser).callonSingleLineQuotedRange1, expr: &seqExpr{ - pos: position{line: 676, col: 26, offset: 22699}, + pos: position{line: 607, col: 26, offset: 20445}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 676, col: 26, offset: 22699}, + pos: position{line: 607, col: 26, offset: 20445}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 676, col: 31, offset: 22704}, + pos: position{line: 607, col: 31, offset: 20450}, label: "singleline", expr: &ruleRefExpr{ - pos: position{line: 676, col: 43, offset: 22716}, + pos: position{line: 607, col: 43, offset: 20462}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 676, col: 51, offset: 22724}, + pos: position{line: 607, col: 51, offset: 20470}, val: "\"", ignoreCase: false, want: "\"\\\"\"", @@ -5330,14 +4806,14 @@ var g = &grammar{ }, { name: "UndefinedLineRange", - pos: position{line: 680, col: 1, offset: 22816}, + pos: position{line: 611, col: 1, offset: 20562}, expr: &actionExpr{ - pos: position{line: 680, col: 23, offset: 22838}, + pos: position{line: 611, col: 23, offset: 20584}, run: (*parser).callonUndefinedLineRange1, expr: &zeroOrMoreExpr{ - pos: position{line: 680, col: 23, offset: 22838}, + pos: position{line: 611, col: 23, offset: 20584}, expr: &charClassMatcher{ - pos: position{line: 680, col: 23, offset: 22838}, + pos: position{line: 611, col: 23, offset: 20584}, val: "[^\\], ]", chars: []rune{']', ',', ' '}, ignoreCase: false, @@ -5348,24 +4824,24 @@ var g = &grammar{ }, { name: "TagRangesAttribute", - pos: position{line: 684, col: 1, offset: 22883}, + pos: position{line: 615, col: 1, offset: 20629}, expr: &actionExpr{ - pos: position{line: 684, col: 23, offset: 22905}, + pos: position{line: 615, col: 23, offset: 20651}, run: (*parser).callonTagRangesAttribute1, expr: &seqExpr{ - pos: position{line: 684, col: 23, offset: 22905}, + pos: position{line: 615, col: 23, offset: 20651}, exprs: []interface{}{ &choiceExpr{ - pos: position{line: 684, col: 24, offset: 22906}, + pos: position{line: 615, col: 24, offset: 20652}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 684, col: 24, offset: 22906}, + pos: position{line: 615, col: 24, offset: 20652}, val: "tags=", ignoreCase: false, want: "\"tags=\"", }, &litMatcher{ - pos: position{line: 684, col: 34, offset: 22916}, + pos: position{line: 615, col: 34, offset: 20662}, val: "tag=", ignoreCase: false, want: "\"tag=\"", @@ -5373,17 +4849,17 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 684, col: 42, offset: 22924}, + pos: position{line: 615, col: 42, offset: 20670}, label: "tags", expr: &ruleRefExpr{ - pos: position{line: 684, col: 48, offset: 22930}, + pos: position{line: 615, col: 48, offset: 20676}, name: "TagRangesAttributeValue", }, }, &zeroOrOneExpr{ - pos: position{line: 684, col: 73, offset: 22955}, + pos: position{line: 615, col: 73, offset: 20701}, expr: &litMatcher{ - pos: position{line: 684, col: 73, offset: 22955}, + pos: position{line: 615, col: 73, offset: 20701}, val: ",", ignoreCase: false, want: "\",\"", @@ -5395,44 +4871,44 @@ var g = &grammar{ }, { name: "TagRangesAttributeValue", - pos: position{line: 688, col: 1, offset: 23104}, + pos: position{line: 619, col: 1, offset: 20850}, expr: &actionExpr{ - pos: position{line: 688, col: 28, offset: 23131}, + pos: position{line: 619, col: 28, offset: 20877}, run: (*parser).callonTagRangesAttributeValue1, expr: &seqExpr{ - pos: position{line: 688, col: 28, offset: 23131}, + pos: position{line: 619, col: 28, offset: 20877}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 688, col: 28, offset: 23131}, + pos: position{line: 619, col: 28, offset: 20877}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 688, col: 35, offset: 23138}, + pos: position{line: 619, col: 35, offset: 20884}, name: "MultipleTagRanges", }, }, &zeroOrMoreExpr{ - pos: position{line: 688, col: 54, offset: 23157}, + pos: position{line: 619, col: 54, offset: 20903}, expr: &ruleRefExpr{ - pos: position{line: 688, col: 54, offset: 23157}, + pos: position{line: 619, col: 54, offset: 20903}, name: "Space", }, }, &choiceExpr{ - pos: position{line: 688, col: 62, offset: 23165}, + pos: position{line: 619, col: 62, offset: 20911}, alternatives: []interface{}{ &andExpr{ - pos: position{line: 688, col: 62, offset: 23165}, + pos: position{line: 619, col: 62, offset: 20911}, expr: &litMatcher{ - pos: position{line: 688, col: 63, offset: 23166}, + pos: position{line: 619, col: 63, offset: 20912}, val: ",", ignoreCase: false, want: "\",\"", }, }, &andExpr{ - pos: position{line: 688, col: 69, offset: 23172}, + pos: position{line: 619, col: 69, offset: 20918}, expr: &litMatcher{ - pos: position{line: 688, col: 70, offset: 23173}, + pos: position{line: 619, col: 70, offset: 20919}, val: "]", ignoreCase: false, want: "\"]\"", @@ -5446,43 +4922,43 @@ var g = &grammar{ }, { name: "MultipleTagRanges", - pos: position{line: 692, col: 1, offset: 23205}, + pos: position{line: 623, col: 1, offset: 20951}, expr: &actionExpr{ - pos: position{line: 692, col: 22, offset: 23226}, + pos: position{line: 623, col: 22, offset: 20972}, run: (*parser).callonMultipleTagRanges1, expr: &seqExpr{ - pos: position{line: 692, col: 22, offset: 23226}, + pos: position{line: 623, col: 22, offset: 20972}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 692, col: 22, offset: 23226}, + pos: position{line: 623, col: 22, offset: 20972}, label: "first", expr: &ruleRefExpr{ - pos: position{line: 692, col: 29, offset: 23233}, + pos: position{line: 623, col: 29, offset: 20979}, name: "TagRange", }, }, &labeledExpr{ - pos: position{line: 693, col: 5, offset: 23247}, + pos: position{line: 624, col: 5, offset: 20993}, label: "others", expr: &zeroOrMoreExpr{ - pos: position{line: 693, col: 12, offset: 23254}, + pos: position{line: 624, col: 12, offset: 21000}, expr: &actionExpr{ - pos: position{line: 693, col: 13, offset: 23255}, + pos: position{line: 624, col: 13, offset: 21001}, run: (*parser).callonMultipleTagRanges7, expr: &seqExpr{ - pos: position{line: 693, col: 13, offset: 23255}, + pos: position{line: 624, col: 13, offset: 21001}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 693, col: 13, offset: 23255}, + pos: position{line: 624, col: 13, offset: 21001}, val: ";", ignoreCase: false, want: "\";\"", }, &labeledExpr{ - pos: position{line: 693, col: 17, offset: 23259}, + pos: position{line: 624, col: 17, offset: 21005}, label: "other", expr: &ruleRefExpr{ - pos: position{line: 693, col: 24, offset: 23266}, + pos: position{line: 624, col: 24, offset: 21012}, name: "TagRange", }, }, @@ -5497,25 +4973,25 @@ var g = &grammar{ }, { name: "TagRange", - pos: position{line: 699, col: 1, offset: 23397}, + pos: position{line: 630, col: 1, offset: 21143}, expr: &choiceExpr{ - pos: position{line: 699, col: 13, offset: 23409}, + pos: position{line: 630, col: 13, offset: 21155}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 699, col: 13, offset: 23409}, + pos: position{line: 630, col: 13, offset: 21155}, run: (*parser).callonTagRange2, expr: &labeledExpr{ - pos: position{line: 699, col: 13, offset: 23409}, + pos: position{line: 630, col: 13, offset: 21155}, label: "tag", expr: &choiceExpr{ - pos: position{line: 699, col: 18, offset: 23414}, + pos: position{line: 630, col: 18, offset: 21160}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 699, col: 18, offset: 23414}, + pos: position{line: 630, col: 18, offset: 21160}, name: "Alphanums", }, &ruleRefExpr{ - pos: position{line: 699, col: 30, offset: 23426}, + pos: position{line: 630, col: 30, offset: 21172}, name: "TagWildcard", }, }, @@ -5523,29 +4999,29 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 701, col: 5, offset: 23494}, + pos: position{line: 632, col: 5, offset: 21240}, run: (*parser).callonTagRange7, expr: &seqExpr{ - pos: position{line: 701, col: 5, offset: 23494}, + pos: position{line: 632, col: 5, offset: 21240}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 701, col: 5, offset: 23494}, + pos: position{line: 632, col: 5, offset: 21240}, val: "!", ignoreCase: false, want: "\"!\"", }, &labeledExpr{ - pos: position{line: 701, col: 9, offset: 23498}, + pos: position{line: 632, col: 9, offset: 21244}, label: "tag", expr: &choiceExpr{ - pos: position{line: 701, col: 14, offset: 23503}, + pos: position{line: 632, col: 14, offset: 21249}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 701, col: 14, offset: 23503}, + pos: position{line: 632, col: 14, offset: 21249}, name: "Alphanums", }, &ruleRefExpr{ - pos: position{line: 701, col: 26, offset: 23515}, + pos: position{line: 632, col: 26, offset: 21261}, name: "TagWildcard", }, }, @@ -5559,23 +5035,23 @@ var g = &grammar{ }, { name: "TagWildcard", - pos: position{line: 705, col: 1, offset: 23583}, + pos: position{line: 636, col: 1, offset: 21329}, expr: &actionExpr{ - pos: position{line: 705, col: 16, offset: 23598}, + pos: position{line: 636, col: 16, offset: 21344}, run: (*parser).callonTagWildcard1, expr: &seqExpr{ - pos: position{line: 705, col: 16, offset: 23598}, + pos: position{line: 636, col: 16, offset: 21344}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 705, col: 16, offset: 23598}, + pos: position{line: 636, col: 16, offset: 21344}, label: "stars", expr: &actionExpr{ - pos: position{line: 705, col: 23, offset: 23605}, + pos: position{line: 636, col: 23, offset: 21351}, run: (*parser).callonTagWildcard4, expr: &oneOrMoreExpr{ - pos: position{line: 705, col: 23, offset: 23605}, + pos: position{line: 636, col: 23, offset: 21351}, expr: &litMatcher{ - pos: position{line: 705, col: 24, offset: 23606}, + pos: position{line: 636, col: 24, offset: 21352}, val: "*", ignoreCase: false, want: "\"*\"", @@ -5584,7 +5060,7 @@ var g = &grammar{ }, }, &andCodeExpr{ - pos: position{line: 708, col: 5, offset: 23660}, + pos: position{line: 639, col: 5, offset: 21406}, run: (*parser).callonTagWildcard7, }, }, @@ -5593,30 +5069,30 @@ var g = &grammar{ }, { name: "VerbatimFileLine", - pos: position{line: 716, col: 1, offset: 23840}, + pos: position{line: 647, col: 1, offset: 21586}, expr: &actionExpr{ - pos: position{line: 716, col: 21, offset: 23860}, + pos: position{line: 647, col: 21, offset: 21606}, run: (*parser).callonVerbatimFileLine1, expr: &seqExpr{ - pos: position{line: 716, col: 21, offset: 23860}, + pos: position{line: 647, col: 21, offset: 21606}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 716, col: 21, offset: 23860}, + pos: position{line: 647, col: 21, offset: 21606}, expr: &ruleRefExpr{ - pos: position{line: 716, col: 22, offset: 23861}, + pos: position{line: 647, col: 22, offset: 21607}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 716, col: 26, offset: 23865}, + pos: position{line: 647, col: 26, offset: 21611}, label: "content", expr: &actionExpr{ - pos: position{line: 716, col: 35, offset: 23874}, + pos: position{line: 647, col: 35, offset: 21620}, run: (*parser).callonVerbatimFileLine6, expr: &zeroOrMoreExpr{ - pos: position{line: 716, col: 35, offset: 23874}, + pos: position{line: 647, col: 35, offset: 21620}, expr: &charClassMatcher{ - pos: position{line: 716, col: 35, offset: 23874}, + pos: position{line: 647, col: 35, offset: 21620}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -5626,7 +5102,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 718, col: 12, offset: 23936}, + pos: position{line: 649, col: 12, offset: 21682}, name: "EOL", }, }, @@ -5635,22 +5111,22 @@ var g = &grammar{ }, { name: "RawFileContent", - pos: position{line: 723, col: 1, offset: 24083}, + pos: position{line: 654, col: 1, offset: 21829}, expr: &zeroOrMoreExpr{ - pos: position{line: 723, col: 19, offset: 24101}, + pos: position{line: 654, col: 19, offset: 21847}, expr: &choiceExpr{ - pos: position{line: 723, col: 20, offset: 24102}, + pos: position{line: 654, col: 20, offset: 21848}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 723, col: 20, offset: 24102}, + pos: position{line: 654, col: 20, offset: 21848}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 723, col: 36, offset: 24118}, + pos: position{line: 654, col: 36, offset: 21864}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 723, col: 56, offset: 24138}, + pos: position{line: 654, col: 56, offset: 21884}, name: "RawLine", }, }, @@ -5659,34 +5135,34 @@ var g = &grammar{ }, { name: "IncludedFileLine", - pos: position{line: 729, col: 1, offset: 24285}, + pos: position{line: 660, col: 1, offset: 22031}, expr: &actionExpr{ - pos: position{line: 729, col: 21, offset: 24305}, + pos: position{line: 660, col: 21, offset: 22051}, run: (*parser).callonIncludedFileLine1, expr: &seqExpr{ - pos: position{line: 729, col: 21, offset: 24305}, + pos: position{line: 660, col: 21, offset: 22051}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 729, col: 21, offset: 24305}, + pos: position{line: 660, col: 21, offset: 22051}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 729, col: 29, offset: 24313}, + pos: position{line: 660, col: 29, offset: 22059}, expr: &choiceExpr{ - pos: position{line: 729, col: 30, offset: 24314}, + pos: position{line: 660, col: 30, offset: 22060}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 729, col: 30, offset: 24314}, + pos: position{line: 660, col: 30, offset: 22060}, name: "IncludedFileStartTag", }, &ruleRefExpr{ - pos: position{line: 729, col: 53, offset: 24337}, + pos: position{line: 660, col: 53, offset: 22083}, name: "IncludedFileEndTag", }, &actionExpr{ - pos: position{line: 729, col: 74, offset: 24358}, + pos: position{line: 660, col: 74, offset: 22104}, run: (*parser).callonIncludedFileLine8, expr: &anyMatcher{ - line: 729, col: 74, offset: 24358, + line: 660, col: 74, offset: 22104, }, }, }, @@ -5694,7 +5170,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 729, col: 107, offset: 24391}, + pos: position{line: 660, col: 107, offset: 22137}, name: "EOL", }, }, @@ -5703,33 +5179,33 @@ var g = &grammar{ }, { name: "IncludedFileStartTag", - pos: position{line: 733, col: 1, offset: 24462}, + pos: position{line: 664, col: 1, offset: 22208}, expr: &actionExpr{ - pos: position{line: 733, col: 25, offset: 24486}, + pos: position{line: 664, col: 25, offset: 22232}, run: (*parser).callonIncludedFileStartTag1, expr: &seqExpr{ - pos: position{line: 733, col: 25, offset: 24486}, + pos: position{line: 664, col: 25, offset: 22232}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 733, col: 25, offset: 24486}, + pos: position{line: 664, col: 25, offset: 22232}, val: "tag::", ignoreCase: false, want: "\"tag::\"", }, &labeledExpr{ - pos: position{line: 733, col: 33, offset: 24494}, + pos: position{line: 664, col: 33, offset: 22240}, label: "tag", expr: &actionExpr{ - pos: position{line: 733, col: 38, offset: 24499}, + pos: position{line: 664, col: 38, offset: 22245}, run: (*parser).callonIncludedFileStartTag5, expr: &ruleRefExpr{ - pos: position{line: 733, col: 38, offset: 24499}, + pos: position{line: 664, col: 38, offset: 22245}, name: "Alphanums", }, }, }, &litMatcher{ - pos: position{line: 733, col: 78, offset: 24539}, + pos: position{line: 664, col: 78, offset: 22285}, val: "[]", ignoreCase: false, want: "\"[]\"", @@ -5740,33 +5216,33 @@ var g = &grammar{ }, { name: "IncludedFileEndTag", - pos: position{line: 737, col: 1, offset: 24604}, + pos: position{line: 668, col: 1, offset: 22350}, expr: &actionExpr{ - pos: position{line: 737, col: 23, offset: 24626}, + pos: position{line: 668, col: 23, offset: 22372}, run: (*parser).callonIncludedFileEndTag1, expr: &seqExpr{ - pos: position{line: 737, col: 23, offset: 24626}, + pos: position{line: 668, col: 23, offset: 22372}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 737, col: 23, offset: 24626}, + pos: position{line: 668, col: 23, offset: 22372}, val: "end::", ignoreCase: false, want: "\"end::\"", }, &labeledExpr{ - pos: position{line: 737, col: 31, offset: 24634}, + pos: position{line: 668, col: 31, offset: 22380}, label: "tag", expr: &actionExpr{ - pos: position{line: 737, col: 36, offset: 24639}, + pos: position{line: 668, col: 36, offset: 22385}, run: (*parser).callonIncludedFileEndTag5, expr: &ruleRefExpr{ - pos: position{line: 737, col: 36, offset: 24639}, + pos: position{line: 668, col: 36, offset: 22385}, name: "Alphanums", }, }, }, &litMatcher{ - pos: position{line: 737, col: 76, offset: 24679}, + pos: position{line: 668, col: 76, offset: 22425}, val: "[]", ignoreCase: false, want: "\"[]\"", @@ -5777,32 +5253,32 @@ var g = &grammar{ }, { name: "ListParagraph", - pos: position{line: 744, col: 1, offset: 24843}, + pos: position{line: 675, col: 1, offset: 22589}, expr: &choiceExpr{ - pos: position{line: 744, col: 18, offset: 24860}, + pos: position{line: 675, col: 18, offset: 22606}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 744, col: 18, offset: 24860}, + pos: position{line: 675, col: 18, offset: 22606}, run: (*parser).callonListParagraph2, expr: &labeledExpr{ - pos: position{line: 744, col: 18, offset: 24860}, + pos: position{line: 675, col: 18, offset: 22606}, label: "comment", expr: &ruleRefExpr{ - pos: position{line: 744, col: 27, offset: 24869}, + pos: position{line: 675, col: 27, offset: 22615}, name: "SingleLineComment", }, }, }, &actionExpr{ - pos: position{line: 746, col: 9, offset: 24926}, + pos: position{line: 677, col: 9, offset: 22672}, run: (*parser).callonListParagraph5, expr: &labeledExpr{ - pos: position{line: 746, col: 9, offset: 24926}, + pos: position{line: 677, col: 9, offset: 22672}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 746, col: 15, offset: 24932}, + pos: position{line: 677, col: 15, offset: 22678}, expr: &ruleRefExpr{ - pos: position{line: 746, col: 16, offset: 24933}, + pos: position{line: 677, col: 16, offset: 22679}, name: "ListParagraphLine", }, }, @@ -5813,96 +5289,96 @@ var g = &grammar{ }, { name: "ListParagraphLine", - pos: position{line: 750, col: 1, offset: 25025}, + pos: position{line: 681, col: 1, offset: 22771}, expr: &actionExpr{ - pos: position{line: 750, col: 22, offset: 25046}, + pos: position{line: 681, col: 22, offset: 22792}, run: (*parser).callonListParagraphLine1, expr: &seqExpr{ - pos: position{line: 750, col: 22, offset: 25046}, + pos: position{line: 681, col: 22, offset: 22792}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 750, col: 22, offset: 25046}, + pos: position{line: 681, col: 22, offset: 22792}, expr: &ruleRefExpr{ - pos: position{line: 750, col: 23, offset: 25047}, + pos: position{line: 681, col: 23, offset: 22793}, name: "EOF", }, }, ¬Expr{ - pos: position{line: 751, col: 5, offset: 25055}, + pos: position{line: 682, col: 5, offset: 22801}, expr: &ruleRefExpr{ - pos: position{line: 751, col: 6, offset: 25056}, + pos: position{line: 682, col: 6, offset: 22802}, name: "BlankLine", }, }, ¬Expr{ - pos: position{line: 752, col: 5, offset: 25071}, + pos: position{line: 683, col: 5, offset: 22817}, expr: &ruleRefExpr{ - pos: position{line: 752, col: 6, offset: 25072}, + pos: position{line: 683, col: 6, offset: 22818}, name: "SingleLineComment", }, }, ¬Expr{ - pos: position{line: 753, col: 5, offset: 25094}, + pos: position{line: 684, col: 5, offset: 22840}, expr: &ruleRefExpr{ - pos: position{line: 753, col: 6, offset: 25095}, + pos: position{line: 684, col: 6, offset: 22841}, name: "OrderedListItemPrefix", }, }, ¬Expr{ - pos: position{line: 754, col: 5, offset: 25121}, + pos: position{line: 685, col: 5, offset: 22867}, expr: &ruleRefExpr{ - pos: position{line: 754, col: 6, offset: 25122}, + pos: position{line: 685, col: 6, offset: 22868}, name: "UnorderedListItemPrefix", }, }, ¬Expr{ - pos: position{line: 755, col: 5, offset: 25150}, + pos: position{line: 686, col: 5, offset: 22896}, expr: &ruleRefExpr{ - pos: position{line: 755, col: 6, offset: 25151}, + pos: position{line: 686, col: 6, offset: 22897}, name: "CalloutListItemPrefix", }, }, ¬Expr{ - pos: position{line: 756, col: 5, offset: 25177}, + pos: position{line: 687, col: 5, offset: 22923}, expr: &ruleRefExpr{ - pos: position{line: 756, col: 6, offset: 25178}, + pos: position{line: 687, col: 6, offset: 22924}, name: "ListItemContinuation", }, }, ¬Expr{ - pos: position{line: 757, col: 5, offset: 25203}, + pos: position{line: 688, col: 5, offset: 22949}, expr: &ruleRefExpr{ - pos: position{line: 757, col: 6, offset: 25204}, + pos: position{line: 688, col: 6, offset: 22950}, name: "ElementAttribute", }, }, ¬Expr{ - pos: position{line: 758, col: 5, offset: 25225}, + pos: position{line: 689, col: 5, offset: 22971}, expr: &ruleRefExpr{ - pos: position{line: 758, col: 6, offset: 25226}, + pos: position{line: 689, col: 6, offset: 22972}, name: "BlockDelimiter", }, }, ¬Expr{ - pos: position{line: 759, col: 5, offset: 25245}, + pos: position{line: 690, col: 5, offset: 22991}, expr: &ruleRefExpr{ - pos: position{line: 759, col: 6, offset: 25246}, + pos: position{line: 690, col: 6, offset: 22992}, name: "LabeledListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 760, col: 5, offset: 25273}, + pos: position{line: 691, col: 5, offset: 23019}, label: "line", expr: &actionExpr{ - pos: position{line: 760, col: 11, offset: 25279}, + pos: position{line: 691, col: 11, offset: 23025}, run: (*parser).callonListParagraphLine24, expr: &labeledExpr{ - pos: position{line: 760, col: 11, offset: 25279}, + pos: position{line: 691, col: 11, offset: 23025}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 760, col: 20, offset: 25288}, + pos: position{line: 691, col: 20, offset: 23034}, expr: &ruleRefExpr{ - pos: position{line: 760, col: 21, offset: 25289}, + pos: position{line: 691, col: 21, offset: 23035}, name: "InlineElement", }, }, @@ -5910,7 +5386,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 762, col: 12, offset: 25388}, + pos: position{line: 693, col: 12, offset: 23134}, name: "EOL", }, }, @@ -5919,25 +5395,25 @@ var g = &grammar{ }, { name: "ListItemContinuation", - pos: position{line: 766, col: 1, offset: 25427}, + pos: position{line: 697, col: 1, offset: 23173}, expr: &seqExpr{ - pos: position{line: 766, col: 25, offset: 25451}, + pos: position{line: 697, col: 25, offset: 23197}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 766, col: 25, offset: 25451}, + pos: position{line: 697, col: 25, offset: 23197}, val: "+", ignoreCase: false, want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 766, col: 29, offset: 25455}, + pos: position{line: 697, col: 29, offset: 23201}, expr: &ruleRefExpr{ - pos: position{line: 766, col: 29, offset: 25455}, + pos: position{line: 697, col: 29, offset: 23201}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 766, col: 36, offset: 25462}, + pos: position{line: 697, col: 36, offset: 23208}, name: "Newline", }, }, @@ -5945,22 +5421,22 @@ var g = &grammar{ }, { name: "ContinuedListItemElement", - pos: position{line: 768, col: 1, offset: 25534}, + pos: position{line: 699, col: 1, offset: 23280}, expr: &actionExpr{ - pos: position{line: 768, col: 29, offset: 25562}, + pos: position{line: 699, col: 29, offset: 23308}, run: (*parser).callonContinuedListItemElement1, expr: &seqExpr{ - pos: position{line: 768, col: 29, offset: 25562}, + pos: position{line: 699, col: 29, offset: 23308}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 768, col: 29, offset: 25562}, + pos: position{line: 699, col: 29, offset: 23308}, name: "ListItemContinuation", }, &labeledExpr{ - pos: position{line: 768, col: 50, offset: 25583}, + pos: position{line: 699, col: 50, offset: 23329}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 768, col: 58, offset: 25591}, + pos: position{line: 699, col: 58, offset: 23337}, name: "ContinuedListItemContent", }, }, @@ -5970,84 +5446,84 @@ var g = &grammar{ }, { name: "ContinuedListItemContent", - pos: position{line: 772, col: 1, offset: 25697}, + pos: position{line: 703, col: 1, offset: 23443}, expr: &actionExpr{ - pos: position{line: 772, col: 29, offset: 25725}, + pos: position{line: 703, col: 29, offset: 23471}, run: (*parser).callonContinuedListItemContent1, expr: &seqExpr{ - pos: position{line: 772, col: 29, offset: 25725}, + pos: position{line: 703, col: 29, offset: 23471}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 772, col: 29, offset: 25725}, + pos: position{line: 703, col: 29, offset: 23471}, expr: &ruleRefExpr{ - pos: position{line: 772, col: 30, offset: 25726}, + pos: position{line: 703, col: 30, offset: 23472}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 773, col: 5, offset: 25735}, + pos: position{line: 704, col: 5, offset: 23481}, label: "content", expr: &choiceExpr{ - pos: position{line: 773, col: 14, offset: 25744}, + pos: position{line: 704, col: 14, offset: 23490}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 773, col: 14, offset: 25744}, + pos: position{line: 704, col: 14, offset: 23490}, name: "DelimitedBlock", }, &ruleRefExpr{ - pos: position{line: 774, col: 11, offset: 25769}, + pos: position{line: 705, col: 11, offset: 23515}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 775, col: 11, offset: 25793}, + pos: position{line: 706, col: 11, offset: 23539}, name: "ImageBlock", }, &ruleRefExpr{ - pos: position{line: 776, col: 11, offset: 25814}, + pos: position{line: 707, col: 11, offset: 23560}, name: "RawVerseParagraph", }, &ruleRefExpr{ - pos: position{line: 777, col: 11, offset: 25842}, + pos: position{line: 708, col: 11, offset: 23588}, name: "ThematicBreak", }, &ruleRefExpr{ - pos: position{line: 778, col: 11, offset: 25866}, + pos: position{line: 709, col: 11, offset: 23612}, name: "OrderedListItem", }, &ruleRefExpr{ - pos: position{line: 779, col: 11, offset: 25893}, + pos: position{line: 710, col: 11, offset: 23639}, name: "UnorderedListItem", }, &ruleRefExpr{ - pos: position{line: 780, col: 11, offset: 25922}, + pos: position{line: 711, col: 11, offset: 23668}, name: "LabeledListItem", }, &ruleRefExpr{ - pos: position{line: 782, col: 11, offset: 25987}, + pos: position{line: 713, col: 11, offset: 23733}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 783, col: 11, offset: 26038}, + pos: position{line: 714, col: 11, offset: 23784}, name: "LiteralBlock", }, &ruleRefExpr{ - pos: position{line: 784, col: 11, offset: 26062}, + pos: position{line: 715, col: 11, offset: 23808}, name: "AttributeDeclaration", }, &ruleRefExpr{ - pos: position{line: 785, col: 11, offset: 26094}, + pos: position{line: 716, col: 11, offset: 23840}, name: "AttributeReset", }, &ruleRefExpr{ - pos: position{line: 786, col: 11, offset: 26120}, + pos: position{line: 717, col: 11, offset: 23866}, name: "TableOfContentsPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 787, col: 11, offset: 26157}, + pos: position{line: 718, col: 11, offset: 23903}, name: "UserMacroBlock", }, &ruleRefExpr{ - pos: position{line: 788, col: 11, offset: 26182}, + pos: position{line: 719, col: 11, offset: 23928}, name: "ContinuedRawParagraph", }, }, @@ -6059,37 +5535,37 @@ var g = &grammar{ }, { name: "OrderedListItem", - pos: position{line: 795, col: 1, offset: 26348}, + pos: position{line: 726, col: 1, offset: 24094}, expr: &actionExpr{ - pos: position{line: 795, col: 20, offset: 26367}, + pos: position{line: 726, col: 20, offset: 24113}, run: (*parser).callonOrderedListItem1, expr: &seqExpr{ - pos: position{line: 795, col: 20, offset: 26367}, + pos: position{line: 726, col: 20, offset: 24113}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 795, col: 20, offset: 26367}, + pos: position{line: 726, col: 20, offset: 24113}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 795, col: 26, offset: 26373}, + pos: position{line: 726, col: 26, offset: 24119}, expr: &ruleRefExpr{ - pos: position{line: 795, col: 27, offset: 26374}, + pos: position{line: 726, col: 27, offset: 24120}, name: "BlockAttrs", }, }, }, &labeledExpr{ - pos: position{line: 795, col: 40, offset: 26387}, + pos: position{line: 726, col: 40, offset: 24133}, label: "prefix", expr: &ruleRefExpr{ - pos: position{line: 795, col: 48, offset: 26395}, + pos: position{line: 726, col: 48, offset: 24141}, name: "OrderedListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 795, col: 71, offset: 26418}, + pos: position{line: 726, col: 71, offset: 24164}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 795, col: 80, offset: 26427}, + pos: position{line: 726, col: 80, offset: 24173}, name: "OrderedListItemContent", }, }, @@ -6099,42 +5575,42 @@ var g = &grammar{ }, { name: "OrderedListItemPrefix", - pos: position{line: 799, col: 1, offset: 26562}, + pos: position{line: 730, col: 1, offset: 24308}, expr: &actionExpr{ - pos: position{line: 800, col: 5, offset: 26592}, + pos: position{line: 731, col: 5, offset: 24338}, run: (*parser).callonOrderedListItemPrefix1, expr: &seqExpr{ - pos: position{line: 800, col: 5, offset: 26592}, + pos: position{line: 731, col: 5, offset: 24338}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 800, col: 5, offset: 26592}, + pos: position{line: 731, col: 5, offset: 24338}, expr: &ruleRefExpr{ - pos: position{line: 800, col: 5, offset: 26592}, + pos: position{line: 731, col: 5, offset: 24338}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 800, col: 12, offset: 26599}, + pos: position{line: 731, col: 12, offset: 24345}, label: "prefix", expr: &choiceExpr{ - pos: position{line: 802, col: 9, offset: 26662}, + pos: position{line: 733, col: 9, offset: 24408}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 802, col: 9, offset: 26662}, + pos: position{line: 733, col: 9, offset: 24408}, run: (*parser).callonOrderedListItemPrefix7, expr: &seqExpr{ - pos: position{line: 802, col: 9, offset: 26662}, + pos: position{line: 733, col: 9, offset: 24408}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 802, col: 9, offset: 26662}, + pos: position{line: 733, col: 9, offset: 24408}, label: "depth", expr: &actionExpr{ - pos: position{line: 802, col: 16, offset: 26669}, + pos: position{line: 733, col: 16, offset: 24415}, run: (*parser).callonOrderedListItemPrefix10, expr: &oneOrMoreExpr{ - pos: position{line: 802, col: 16, offset: 26669}, + pos: position{line: 733, col: 16, offset: 24415}, expr: &litMatcher{ - pos: position{line: 802, col: 17, offset: 26670}, + pos: position{line: 733, col: 17, offset: 24416}, val: ".", ignoreCase: false, want: "\".\"", @@ -6143,22 +5619,22 @@ var g = &grammar{ }, }, &andCodeExpr{ - pos: position{line: 806, col: 9, offset: 26770}, + pos: position{line: 737, col: 9, offset: 24516}, run: (*parser).callonOrderedListItemPrefix13, }, }, }, }, &actionExpr{ - pos: position{line: 825, col: 11, offset: 27487}, + pos: position{line: 756, col: 11, offset: 25233}, run: (*parser).callonOrderedListItemPrefix14, expr: &seqExpr{ - pos: position{line: 825, col: 11, offset: 27487}, + pos: position{line: 756, col: 11, offset: 25233}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 825, col: 11, offset: 27487}, + pos: position{line: 756, col: 11, offset: 25233}, expr: &charClassMatcher{ - pos: position{line: 825, col: 12, offset: 27488}, + pos: position{line: 756, col: 12, offset: 25234}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -6166,7 +5642,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 825, col: 20, offset: 27496}, + pos: position{line: 756, col: 20, offset: 25242}, val: ".", ignoreCase: false, want: "\".\"", @@ -6175,20 +5651,20 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 827, col: 13, offset: 27607}, + pos: position{line: 758, col: 13, offset: 25353}, run: (*parser).callonOrderedListItemPrefix19, expr: &seqExpr{ - pos: position{line: 827, col: 13, offset: 27607}, + pos: position{line: 758, col: 13, offset: 25353}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 827, col: 14, offset: 27608}, + pos: position{line: 758, col: 14, offset: 25354}, val: "[a-z]", ranges: []rune{'a', 'z'}, ignoreCase: false, inverted: false, }, &litMatcher{ - pos: position{line: 827, col: 21, offset: 27615}, + pos: position{line: 758, col: 21, offset: 25361}, val: ".", ignoreCase: false, want: "\".\"", @@ -6197,20 +5673,20 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 829, col: 13, offset: 27729}, + pos: position{line: 760, col: 13, offset: 25475}, run: (*parser).callonOrderedListItemPrefix23, expr: &seqExpr{ - pos: position{line: 829, col: 13, offset: 27729}, + pos: position{line: 760, col: 13, offset: 25475}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 829, col: 14, offset: 27730}, + pos: position{line: 760, col: 14, offset: 25476}, val: "[A-Z]", ranges: []rune{'A', 'Z'}, ignoreCase: false, inverted: false, }, &litMatcher{ - pos: position{line: 829, col: 21, offset: 27737}, + pos: position{line: 760, col: 21, offset: 25483}, val: ".", ignoreCase: false, want: "\".\"", @@ -6219,15 +5695,15 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 831, col: 13, offset: 27851}, + pos: position{line: 762, col: 13, offset: 25597}, run: (*parser).callonOrderedListItemPrefix27, expr: &seqExpr{ - pos: position{line: 831, col: 13, offset: 27851}, + pos: position{line: 762, col: 13, offset: 25597}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 831, col: 13, offset: 27851}, + pos: position{line: 762, col: 13, offset: 25597}, expr: &charClassMatcher{ - pos: position{line: 831, col: 14, offset: 27852}, + pos: position{line: 762, col: 14, offset: 25598}, val: "[a-z]", ranges: []rune{'a', 'z'}, ignoreCase: false, @@ -6235,7 +5711,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 831, col: 22, offset: 27860}, + pos: position{line: 762, col: 22, offset: 25606}, val: ")", ignoreCase: false, want: "\")\"", @@ -6244,15 +5720,15 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 833, col: 13, offset: 27974}, + pos: position{line: 764, col: 13, offset: 25720}, run: (*parser).callonOrderedListItemPrefix32, expr: &seqExpr{ - pos: position{line: 833, col: 13, offset: 27974}, + pos: position{line: 764, col: 13, offset: 25720}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 833, col: 13, offset: 27974}, + pos: position{line: 764, col: 13, offset: 25720}, expr: &charClassMatcher{ - pos: position{line: 833, col: 14, offset: 27975}, + pos: position{line: 764, col: 14, offset: 25721}, val: "[A-Z]", ranges: []rune{'A', 'Z'}, ignoreCase: false, @@ -6260,7 +5736,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 833, col: 22, offset: 27983}, + pos: position{line: 764, col: 22, offset: 25729}, val: ")", ignoreCase: false, want: "\")\"", @@ -6272,9 +5748,9 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 835, col: 12, offset: 28096}, + pos: position{line: 766, col: 12, offset: 25842}, expr: &ruleRefExpr{ - pos: position{line: 835, col: 12, offset: 28096}, + pos: position{line: 766, col: 12, offset: 25842}, name: "Space", }, }, @@ -6284,17 +5760,17 @@ var g = &grammar{ }, { name: "OrderedListItemContent", - pos: position{line: 839, col: 1, offset: 28131}, + pos: position{line: 770, col: 1, offset: 25877}, expr: &actionExpr{ - pos: position{line: 839, col: 27, offset: 28157}, + pos: position{line: 770, col: 27, offset: 25903}, run: (*parser).callonOrderedListItemContent1, expr: &labeledExpr{ - pos: position{line: 839, col: 27, offset: 28157}, + pos: position{line: 770, col: 27, offset: 25903}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 839, col: 37, offset: 28167}, + pos: position{line: 770, col: 37, offset: 25913}, expr: &ruleRefExpr{ - pos: position{line: 839, col: 37, offset: 28167}, + pos: position{line: 770, col: 37, offset: 25913}, name: "ListParagraph", }, }, @@ -6303,48 +5779,48 @@ var g = &grammar{ }, { name: "UnorderedListItem", - pos: position{line: 846, col: 1, offset: 28367}, + pos: position{line: 777, col: 1, offset: 26113}, expr: &actionExpr{ - pos: position{line: 846, col: 22, offset: 28388}, + pos: position{line: 777, col: 22, offset: 26134}, run: (*parser).callonUnorderedListItem1, expr: &seqExpr{ - pos: position{line: 846, col: 22, offset: 28388}, + pos: position{line: 777, col: 22, offset: 26134}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 846, col: 22, offset: 28388}, + pos: position{line: 777, col: 22, offset: 26134}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 846, col: 28, offset: 28394}, + pos: position{line: 777, col: 28, offset: 26140}, expr: &ruleRefExpr{ - pos: position{line: 846, col: 29, offset: 28395}, + pos: position{line: 777, col: 29, offset: 26141}, name: "BlockAttrs", }, }, }, &labeledExpr{ - pos: position{line: 846, col: 42, offset: 28408}, + pos: position{line: 777, col: 42, offset: 26154}, label: "prefix", expr: &ruleRefExpr{ - pos: position{line: 846, col: 50, offset: 28416}, + pos: position{line: 777, col: 50, offset: 26162}, name: "UnorderedListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 846, col: 75, offset: 28441}, + pos: position{line: 777, col: 75, offset: 26187}, label: "checkstyle", expr: &zeroOrOneExpr{ - pos: position{line: 846, col: 86, offset: 28452}, + pos: position{line: 777, col: 86, offset: 26198}, expr: &ruleRefExpr{ - pos: position{line: 846, col: 87, offset: 28453}, + pos: position{line: 777, col: 87, offset: 26199}, name: "UnorderedListItemCheckStyle", }, }, }, &labeledExpr{ - pos: position{line: 846, col: 117, offset: 28483}, + pos: position{line: 777, col: 117, offset: 26229}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 846, col: 126, offset: 28492}, + pos: position{line: 777, col: 126, offset: 26238}, name: "UnorderedListItemContent", }, }, @@ -6354,42 +5830,42 @@ var g = &grammar{ }, { name: "UnorderedListItemPrefix", - pos: position{line: 850, col: 1, offset: 28645}, + pos: position{line: 781, col: 1, offset: 26391}, expr: &actionExpr{ - pos: position{line: 851, col: 5, offset: 28677}, + pos: position{line: 782, col: 5, offset: 26423}, run: (*parser).callonUnorderedListItemPrefix1, expr: &seqExpr{ - pos: position{line: 851, col: 5, offset: 28677}, + pos: position{line: 782, col: 5, offset: 26423}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 851, col: 5, offset: 28677}, + pos: position{line: 782, col: 5, offset: 26423}, expr: &ruleRefExpr{ - pos: position{line: 851, col: 5, offset: 28677}, + pos: position{line: 782, col: 5, offset: 26423}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 851, col: 12, offset: 28684}, + pos: position{line: 782, col: 12, offset: 26430}, label: "prefix", expr: &choiceExpr{ - pos: position{line: 851, col: 20, offset: 28692}, + pos: position{line: 782, col: 20, offset: 26438}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 853, col: 9, offset: 28749}, + pos: position{line: 784, col: 9, offset: 26495}, run: (*parser).callonUnorderedListItemPrefix7, expr: &seqExpr{ - pos: position{line: 853, col: 9, offset: 28749}, + pos: position{line: 784, col: 9, offset: 26495}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 853, col: 9, offset: 28749}, + pos: position{line: 784, col: 9, offset: 26495}, label: "depth", expr: &actionExpr{ - pos: position{line: 853, col: 16, offset: 28756}, + pos: position{line: 784, col: 16, offset: 26502}, run: (*parser).callonUnorderedListItemPrefix10, expr: &oneOrMoreExpr{ - pos: position{line: 853, col: 16, offset: 28756}, + pos: position{line: 784, col: 16, offset: 26502}, expr: &litMatcher{ - pos: position{line: 853, col: 17, offset: 28757}, + pos: position{line: 784, col: 17, offset: 26503}, val: "*", ignoreCase: false, want: "\"*\"", @@ -6398,20 +5874,20 @@ var g = &grammar{ }, }, &andCodeExpr{ - pos: position{line: 857, col: 9, offset: 28857}, + pos: position{line: 788, col: 9, offset: 26603}, run: (*parser).callonUnorderedListItemPrefix13, }, }, }, }, &labeledExpr{ - pos: position{line: 874, col: 14, offset: 29564}, + pos: position{line: 805, col: 14, offset: 27310}, label: "depth", expr: &actionExpr{ - pos: position{line: 874, col: 21, offset: 29571}, + pos: position{line: 805, col: 21, offset: 27317}, run: (*parser).callonUnorderedListItemPrefix15, expr: &litMatcher{ - pos: position{line: 874, col: 22, offset: 29572}, + pos: position{line: 805, col: 22, offset: 27318}, val: "-", ignoreCase: false, want: "\"-\"", @@ -6422,9 +5898,9 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 876, col: 13, offset: 29658}, + pos: position{line: 807, col: 13, offset: 27404}, expr: &ruleRefExpr{ - pos: position{line: 876, col: 13, offset: 29658}, + pos: position{line: 807, col: 13, offset: 27404}, name: "Space", }, }, @@ -6434,53 +5910,53 @@ var g = &grammar{ }, { name: "UnorderedListItemCheckStyle", - pos: position{line: 880, col: 1, offset: 29694}, + pos: position{line: 811, col: 1, offset: 27440}, expr: &actionExpr{ - pos: position{line: 880, col: 32, offset: 29725}, + pos: position{line: 811, col: 32, offset: 27471}, run: (*parser).callonUnorderedListItemCheckStyle1, expr: &seqExpr{ - pos: position{line: 880, col: 32, offset: 29725}, + pos: position{line: 811, col: 32, offset: 27471}, exprs: []interface{}{ &andExpr{ - pos: position{line: 880, col: 32, offset: 29725}, + pos: position{line: 811, col: 32, offset: 27471}, expr: &litMatcher{ - pos: position{line: 880, col: 33, offset: 29726}, + pos: position{line: 811, col: 33, offset: 27472}, val: "[", ignoreCase: false, want: "\"[\"", }, }, &labeledExpr{ - pos: position{line: 880, col: 37, offset: 29730}, + pos: position{line: 811, col: 37, offset: 27476}, label: "style", expr: &choiceExpr{ - pos: position{line: 881, col: 7, offset: 29744}, + pos: position{line: 812, col: 7, offset: 27490}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 881, col: 7, offset: 29744}, + pos: position{line: 812, col: 7, offset: 27490}, run: (*parser).callonUnorderedListItemCheckStyle7, expr: &litMatcher{ - pos: position{line: 881, col: 7, offset: 29744}, + pos: position{line: 812, col: 7, offset: 27490}, val: "[ ]", ignoreCase: false, want: "\"[ ]\"", }, }, &actionExpr{ - pos: position{line: 882, col: 7, offset: 29789}, + pos: position{line: 813, col: 7, offset: 27535}, run: (*parser).callonUnorderedListItemCheckStyle9, expr: &litMatcher{ - pos: position{line: 882, col: 7, offset: 29789}, + pos: position{line: 813, col: 7, offset: 27535}, val: "[*]", ignoreCase: false, want: "\"[*]\"", }, }, &actionExpr{ - pos: position{line: 883, col: 7, offset: 29832}, + pos: position{line: 814, col: 7, offset: 27578}, run: (*parser).callonUnorderedListItemCheckStyle11, expr: &litMatcher{ - pos: position{line: 883, col: 7, offset: 29832}, + pos: position{line: 814, col: 7, offset: 27578}, val: "[x]", ignoreCase: false, want: "\"[x]\"", @@ -6490,9 +5966,9 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 884, col: 7, offset: 29874}, + pos: position{line: 815, col: 7, offset: 27620}, expr: &ruleRefExpr{ - pos: position{line: 884, col: 7, offset: 29874}, + pos: position{line: 815, col: 7, offset: 27620}, name: "Space", }, }, @@ -6502,17 +5978,17 @@ var g = &grammar{ }, { name: "UnorderedListItemContent", - pos: position{line: 888, col: 1, offset: 29916}, + pos: position{line: 819, col: 1, offset: 27662}, expr: &actionExpr{ - pos: position{line: 888, col: 29, offset: 29944}, + pos: position{line: 819, col: 29, offset: 27690}, run: (*parser).callonUnorderedListItemContent1, expr: &labeledExpr{ - pos: position{line: 888, col: 29, offset: 29944}, + pos: position{line: 819, col: 29, offset: 27690}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 888, col: 39, offset: 29954}, + pos: position{line: 819, col: 39, offset: 27700}, expr: &ruleRefExpr{ - pos: position{line: 888, col: 39, offset: 29954}, + pos: position{line: 819, col: 39, offset: 27700}, name: "ListParagraph", }, }, @@ -6521,47 +5997,47 @@ var g = &grammar{ }, { name: "LabeledListItem", - pos: position{line: 895, col: 1, offset: 30270}, + pos: position{line: 826, col: 1, offset: 28016}, expr: &actionExpr{ - pos: position{line: 895, col: 20, offset: 30289}, + pos: position{line: 826, col: 20, offset: 28035}, run: (*parser).callonLabeledListItem1, expr: &seqExpr{ - pos: position{line: 895, col: 20, offset: 30289}, + pos: position{line: 826, col: 20, offset: 28035}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 895, col: 20, offset: 30289}, + pos: position{line: 826, col: 20, offset: 28035}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 895, col: 26, offset: 30295}, + pos: position{line: 826, col: 26, offset: 28041}, expr: &ruleRefExpr{ - pos: position{line: 895, col: 27, offset: 30296}, + pos: position{line: 826, col: 27, offset: 28042}, name: "BlockAttrs", }, }, }, &labeledExpr{ - pos: position{line: 895, col: 40, offset: 30309}, + pos: position{line: 826, col: 40, offset: 28055}, label: "term", expr: &ruleRefExpr{ - pos: position{line: 895, col: 46, offset: 30315}, + pos: position{line: 826, col: 46, offset: 28061}, name: "VerbatimLabeledListItemTerm", }, }, &labeledExpr{ - pos: position{line: 895, col: 75, offset: 30344}, + pos: position{line: 826, col: 75, offset: 28090}, label: "separator", expr: &ruleRefExpr{ - pos: position{line: 895, col: 86, offset: 30355}, + pos: position{line: 826, col: 86, offset: 28101}, name: "LabeledListItemSeparator", }, }, &labeledExpr{ - pos: position{line: 895, col: 112, offset: 30381}, + pos: position{line: 826, col: 112, offset: 28127}, label: "description", expr: &zeroOrOneExpr{ - pos: position{line: 895, col: 124, offset: 30393}, + pos: position{line: 826, col: 124, offset: 28139}, expr: &ruleRefExpr{ - pos: position{line: 895, col: 125, offset: 30394}, + pos: position{line: 826, col: 125, offset: 28140}, name: "LabeledListItemDescription", }, }, @@ -6572,16 +6048,16 @@ var g = &grammar{ }, { name: "LabeledListItemPrefix", - pos: position{line: 899, col: 1, offset: 30535}, + pos: position{line: 830, col: 1, offset: 28281}, expr: &seqExpr{ - pos: position{line: 899, col: 26, offset: 30560}, + pos: position{line: 830, col: 26, offset: 28306}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 899, col: 26, offset: 30560}, + pos: position{line: 830, col: 26, offset: 28306}, name: "VerbatimLabeledListItemTerm", }, &ruleRefExpr{ - pos: position{line: 899, col: 54, offset: 30588}, + pos: position{line: 830, col: 54, offset: 28334}, name: "LabeledListItemSeparator", }, }, @@ -6589,14 +6065,14 @@ var g = &grammar{ }, { name: "VerbatimLabeledListItemChars", - pos: position{line: 901, col: 1, offset: 30614}, + pos: position{line: 832, col: 1, offset: 28360}, expr: &choiceExpr{ - pos: position{line: 901, col: 33, offset: 30646}, + pos: position{line: 832, col: 33, offset: 28392}, alternatives: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 901, col: 33, offset: 30646}, + pos: position{line: 832, col: 33, offset: 28392}, expr: &charClassMatcher{ - pos: position{line: 901, col: 33, offset: 30646}, + pos: position{line: 832, col: 33, offset: 28392}, val: "[^:\\r\\n]", chars: []rune{':', '\r', '\n'}, ignoreCase: false, @@ -6604,18 +6080,18 @@ var g = &grammar{ }, }, &seqExpr{ - pos: position{line: 901, col: 45, offset: 30658}, + pos: position{line: 832, col: 45, offset: 28404}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 901, col: 45, offset: 30658}, + pos: position{line: 832, col: 45, offset: 28404}, val: ":", ignoreCase: false, want: "\":\"", }, ¬Expr{ - pos: position{line: 901, col: 49, offset: 30662}, + pos: position{line: 832, col: 49, offset: 28408}, expr: &litMatcher{ - pos: position{line: 901, col: 50, offset: 30663}, + pos: position{line: 832, col: 50, offset: 28409}, val: ":", ignoreCase: false, want: "\":\"", @@ -6628,20 +6104,20 @@ var g = &grammar{ }, { name: "VerbatimLabeledListItemTerm", - pos: position{line: 902, col: 1, offset: 30667}, + pos: position{line: 833, col: 1, offset: 28413}, expr: &actionExpr{ - pos: position{line: 902, col: 32, offset: 30698}, + pos: position{line: 833, col: 32, offset: 28444}, run: (*parser).callonVerbatimLabeledListItemTerm1, expr: &labeledExpr{ - pos: position{line: 902, col: 32, offset: 30698}, + pos: position{line: 833, col: 32, offset: 28444}, label: "content", expr: &actionExpr{ - pos: position{line: 902, col: 42, offset: 30708}, + pos: position{line: 833, col: 42, offset: 28454}, run: (*parser).callonVerbatimLabeledListItemTerm3, expr: &oneOrMoreExpr{ - pos: position{line: 902, col: 42, offset: 30708}, + pos: position{line: 833, col: 42, offset: 28454}, expr: &ruleRefExpr{ - pos: position{line: 902, col: 42, offset: 30708}, + pos: position{line: 833, col: 42, offset: 28454}, name: "VerbatimLabeledListItemChars", }, }, @@ -6651,36 +6127,36 @@ var g = &grammar{ }, { name: "LabeledListItemTerm", - pos: position{line: 908, col: 1, offset: 30863}, + pos: position{line: 839, col: 1, offset: 28609}, expr: &actionExpr{ - pos: position{line: 908, col: 24, offset: 30886}, + pos: position{line: 839, col: 24, offset: 28632}, run: (*parser).callonLabeledListItemTerm1, expr: &labeledExpr{ - pos: position{line: 908, col: 24, offset: 30886}, + pos: position{line: 839, col: 24, offset: 28632}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 908, col: 33, offset: 30895}, + pos: position{line: 839, col: 33, offset: 28641}, expr: &seqExpr{ - pos: position{line: 908, col: 34, offset: 30896}, + pos: position{line: 839, col: 34, offset: 28642}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 908, col: 34, offset: 30896}, + pos: position{line: 839, col: 34, offset: 28642}, expr: &ruleRefExpr{ - pos: position{line: 908, col: 35, offset: 30897}, + pos: position{line: 839, col: 35, offset: 28643}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 908, col: 43, offset: 30905}, + pos: position{line: 839, col: 43, offset: 28651}, expr: &litMatcher{ - pos: position{line: 908, col: 44, offset: 30906}, + pos: position{line: 839, col: 44, offset: 28652}, val: "::", ignoreCase: false, want: "\"::\"", }, }, &ruleRefExpr{ - pos: position{line: 908, col: 49, offset: 30911}, + pos: position{line: 839, col: 49, offset: 28657}, name: "LabeledListItemTermElement", }, }, @@ -6691,89 +6167,89 @@ var g = &grammar{ }, { name: "LabeledListItemTermElement", - pos: position{line: 912, col: 1, offset: 31038}, + pos: position{line: 843, col: 1, offset: 28784}, expr: &actionExpr{ - pos: position{line: 912, col: 31, offset: 31068}, + pos: position{line: 843, col: 31, offset: 28814}, run: (*parser).callonLabeledListItemTermElement1, expr: &labeledExpr{ - pos: position{line: 912, col: 31, offset: 31068}, + pos: position{line: 843, col: 31, offset: 28814}, label: "element", expr: &choiceExpr{ - pos: position{line: 912, col: 40, offset: 31077}, + pos: position{line: 843, col: 40, offset: 28823}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 912, col: 40, offset: 31077}, + pos: position{line: 843, col: 40, offset: 28823}, name: "Word", }, &ruleRefExpr{ - pos: position{line: 913, col: 11, offset: 31092}, + pos: position{line: 844, col: 11, offset: 28838}, name: "LineBreak", }, &oneOrMoreExpr{ - pos: position{line: 914, col: 11, offset: 31141}, + pos: position{line: 845, col: 11, offset: 28887}, expr: &ruleRefExpr{ - pos: position{line: 914, col: 11, offset: 31141}, + pos: position{line: 845, col: 11, offset: 28887}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 915, col: 11, offset: 31159}, + pos: position{line: 846, col: 11, offset: 28905}, name: "CrossReference", }, &ruleRefExpr{ - pos: position{line: 916, col: 11, offset: 31184}, + pos: position{line: 847, col: 11, offset: 28930}, name: "ConcealedIndexTerm", }, &ruleRefExpr{ - pos: position{line: 917, col: 11, offset: 31213}, + pos: position{line: 848, col: 11, offset: 28959}, name: "IndexTerm", }, &ruleRefExpr{ - pos: position{line: 918, col: 11, offset: 31233}, + pos: position{line: 849, col: 11, offset: 28979}, name: "InlinePassthrough", }, &ruleRefExpr{ - pos: position{line: 919, col: 11, offset: 31322}, + pos: position{line: 850, col: 11, offset: 29068}, name: "InlineIcon", }, &ruleRefExpr{ - pos: position{line: 920, col: 11, offset: 31343}, + pos: position{line: 851, col: 11, offset: 29089}, name: "InlineImage", }, &ruleRefExpr{ - pos: position{line: 921, col: 11, offset: 31366}, + pos: position{line: 852, col: 11, offset: 29112}, name: "Link", }, &ruleRefExpr{ - pos: position{line: 922, col: 11, offset: 31381}, + pos: position{line: 853, col: 11, offset: 29127}, name: "InlineFootnote", }, &ruleRefExpr{ - pos: position{line: 923, col: 11, offset: 31406}, + pos: position{line: 854, col: 11, offset: 29152}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 924, col: 11, offset: 31429}, + pos: position{line: 855, col: 11, offset: 29175}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 925, col: 11, offset: 31450}, + pos: position{line: 856, col: 11, offset: 29196}, name: "SpecialCharacter", }, &ruleRefExpr{ - pos: position{line: 926, col: 11, offset: 31477}, + pos: position{line: 857, col: 11, offset: 29223}, name: "Symbol", }, &ruleRefExpr{ - pos: position{line: 927, col: 11, offset: 31494}, + pos: position{line: 858, col: 11, offset: 29240}, name: "AttributeSubstitution", }, &ruleRefExpr{ - pos: position{line: 928, col: 11, offset: 31526}, + pos: position{line: 859, col: 11, offset: 29272}, name: "ImpliedApostrophe", }, &ruleRefExpr{ - pos: position{line: 929, col: 11, offset: 31554}, + pos: position{line: 860, col: 11, offset: 29300}, name: "AnyChar", }, }, @@ -6783,23 +6259,23 @@ var g = &grammar{ }, { name: "LabeledListItemSeparator", - pos: position{line: 933, col: 1, offset: 31593}, + pos: position{line: 864, col: 1, offset: 29339}, expr: &actionExpr{ - pos: position{line: 934, col: 5, offset: 31626}, + pos: position{line: 865, col: 5, offset: 29372}, run: (*parser).callonLabeledListItemSeparator1, expr: &seqExpr{ - pos: position{line: 934, col: 5, offset: 31626}, + pos: position{line: 865, col: 5, offset: 29372}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 934, col: 5, offset: 31626}, + pos: position{line: 865, col: 5, offset: 29372}, label: "separator", expr: &actionExpr{ - pos: position{line: 934, col: 16, offset: 31637}, + pos: position{line: 865, col: 16, offset: 29383}, run: (*parser).callonLabeledListItemSeparator4, expr: &oneOrMoreExpr{ - pos: position{line: 934, col: 16, offset: 31637}, + pos: position{line: 865, col: 16, offset: 29383}, expr: &litMatcher{ - pos: position{line: 934, col: 17, offset: 31638}, + pos: position{line: 865, col: 17, offset: 29384}, val: ":", ignoreCase: false, want: "\":\"", @@ -6808,30 +6284,30 @@ var g = &grammar{ }, }, &andCodeExpr{ - pos: position{line: 937, col: 5, offset: 31696}, + pos: position{line: 868, col: 5, offset: 29442}, run: (*parser).callonLabeledListItemSeparator7, }, &choiceExpr{ - pos: position{line: 941, col: 6, offset: 31872}, + pos: position{line: 872, col: 6, offset: 29618}, alternatives: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 941, col: 6, offset: 31872}, + pos: position{line: 872, col: 6, offset: 29618}, expr: &choiceExpr{ - pos: position{line: 941, col: 7, offset: 31873}, + pos: position{line: 872, col: 7, offset: 29619}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 941, col: 7, offset: 31873}, + pos: position{line: 872, col: 7, offset: 29619}, name: "Space", }, &ruleRefExpr{ - pos: position{line: 941, col: 15, offset: 31881}, + pos: position{line: 872, col: 15, offset: 29627}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 941, col: 27, offset: 31893}, + pos: position{line: 872, col: 27, offset: 29639}, name: "EOL", }, }, @@ -6842,17 +6318,17 @@ var g = &grammar{ }, { name: "LabeledListItemDescription", - pos: position{line: 945, col: 1, offset: 31933}, + pos: position{line: 876, col: 1, offset: 29679}, expr: &actionExpr{ - pos: position{line: 945, col: 31, offset: 31963}, + pos: position{line: 876, col: 31, offset: 29709}, run: (*parser).callonLabeledListItemDescription1, expr: &labeledExpr{ - pos: position{line: 945, col: 31, offset: 31963}, + pos: position{line: 876, col: 31, offset: 29709}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 945, col: 40, offset: 31972}, + pos: position{line: 876, col: 40, offset: 29718}, expr: &ruleRefExpr{ - pos: position{line: 945, col: 41, offset: 31973}, + pos: position{line: 876, col: 41, offset: 29719}, name: "ListParagraph", }, }, @@ -6861,55 +6337,55 @@ var g = &grammar{ }, { name: "AdmonitionKind", - pos: position{line: 952, col: 1, offset: 32164}, + pos: position{line: 883, col: 1, offset: 29910}, expr: &choiceExpr{ - pos: position{line: 952, col: 19, offset: 32182}, + pos: position{line: 883, col: 19, offset: 29928}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 952, col: 19, offset: 32182}, + pos: position{line: 883, col: 19, offset: 29928}, run: (*parser).callonAdmonitionKind2, expr: &litMatcher{ - pos: position{line: 952, col: 19, offset: 32182}, + pos: position{line: 883, col: 19, offset: 29928}, val: "TIP", ignoreCase: false, want: "\"TIP\"", }, }, &actionExpr{ - pos: position{line: 954, col: 9, offset: 32228}, + pos: position{line: 885, col: 9, offset: 29974}, run: (*parser).callonAdmonitionKind4, expr: &litMatcher{ - pos: position{line: 954, col: 9, offset: 32228}, + pos: position{line: 885, col: 9, offset: 29974}, val: "NOTE", ignoreCase: false, want: "\"NOTE\"", }, }, &actionExpr{ - pos: position{line: 956, col: 9, offset: 32276}, + pos: position{line: 887, col: 9, offset: 30022}, run: (*parser).callonAdmonitionKind6, expr: &litMatcher{ - pos: position{line: 956, col: 9, offset: 32276}, + pos: position{line: 887, col: 9, offset: 30022}, val: "IMPORTANT", ignoreCase: false, want: "\"IMPORTANT\"", }, }, &actionExpr{ - pos: position{line: 958, col: 9, offset: 32334}, + pos: position{line: 889, col: 9, offset: 30080}, run: (*parser).callonAdmonitionKind8, expr: &litMatcher{ - pos: position{line: 958, col: 9, offset: 32334}, + pos: position{line: 889, col: 9, offset: 30080}, val: "WARNING", ignoreCase: false, want: "\"WARNING\"", }, }, &actionExpr{ - pos: position{line: 960, col: 9, offset: 32388}, + pos: position{line: 891, col: 9, offset: 30134}, run: (*parser).callonAdmonitionKind10, expr: &litMatcher{ - pos: position{line: 960, col: 9, offset: 32388}, + pos: position{line: 891, col: 9, offset: 30134}, val: "CAUTION", ignoreCase: false, want: "\"CAUTION\"", @@ -6920,55 +6396,55 @@ var g = &grammar{ }, { name: "RawParagraph", - pos: position{line: 971, col: 1, offset: 32704}, + pos: position{line: 902, col: 1, offset: 30450}, expr: &choiceExpr{ - pos: position{line: 973, col: 5, offset: 32754}, + pos: position{line: 904, col: 5, offset: 30500}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 973, col: 5, offset: 32754}, + pos: position{line: 904, col: 5, offset: 30500}, run: (*parser).callonRawParagraph2, expr: &seqExpr{ - pos: position{line: 973, col: 5, offset: 32754}, + pos: position{line: 904, col: 5, offset: 30500}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 973, col: 5, offset: 32754}, + pos: position{line: 904, col: 5, offset: 30500}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 973, col: 16, offset: 32765}, + pos: position{line: 904, col: 16, offset: 30511}, expr: &ruleRefExpr{ - pos: position{line: 973, col: 17, offset: 32766}, + pos: position{line: 904, col: 17, offset: 30512}, name: "Attributes", }, }, }, &labeledExpr{ - pos: position{line: 973, col: 30, offset: 32779}, + pos: position{line: 904, col: 30, offset: 30525}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 973, col: 33, offset: 32782}, + pos: position{line: 904, col: 33, offset: 30528}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 973, col: 49, offset: 32798}, + pos: position{line: 904, col: 49, offset: 30544}, val: ": ", ignoreCase: false, want: "\": \"", }, &labeledExpr{ - pos: position{line: 973, col: 54, offset: 32803}, + pos: position{line: 904, col: 54, offset: 30549}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 973, col: 60, offset: 32809}, + pos: position{line: 904, col: 60, offset: 30555}, expr: &choiceExpr{ - pos: position{line: 973, col: 61, offset: 32810}, + pos: position{line: 904, col: 61, offset: 30556}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 973, col: 61, offset: 32810}, + pos: position{line: 904, col: 61, offset: 30556}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 973, col: 81, offset: 32830}, + pos: position{line: 904, col: 81, offset: 30576}, name: "RawParagraphLine", }, }, @@ -6979,33 +6455,33 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 977, col: 5, offset: 33013}, + pos: position{line: 908, col: 5, offset: 30759}, run: (*parser).callonRawParagraph15, expr: &seqExpr{ - pos: position{line: 977, col: 5, offset: 33013}, + pos: position{line: 908, col: 5, offset: 30759}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 977, col: 5, offset: 33013}, + pos: position{line: 908, col: 5, offset: 30759}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 977, col: 16, offset: 33024}, + pos: position{line: 908, col: 16, offset: 30770}, expr: &ruleRefExpr{ - pos: position{line: 977, col: 17, offset: 33025}, + pos: position{line: 908, col: 17, offset: 30771}, name: "Attributes", }, }, }, &litMatcher{ - pos: position{line: 977, col: 30, offset: 33038}, + pos: position{line: 908, col: 30, offset: 30784}, val: "> ", ignoreCase: false, want: "\"> \"", }, &labeledExpr{ - pos: position{line: 977, col: 35, offset: 33043}, + pos: position{line: 908, col: 35, offset: 30789}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 977, col: 44, offset: 33052}, + pos: position{line: 908, col: 44, offset: 30798}, name: "MarkdownQuoteBlockRawContent", }, }, @@ -7013,40 +6489,40 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 981, col: 5, offset: 33242}, + pos: position{line: 912, col: 5, offset: 30988}, run: (*parser).callonRawParagraph23, expr: &seqExpr{ - pos: position{line: 981, col: 5, offset: 33242}, + pos: position{line: 912, col: 5, offset: 30988}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 981, col: 5, offset: 33242}, + pos: position{line: 912, col: 5, offset: 30988}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 981, col: 16, offset: 33253}, + pos: position{line: 912, col: 16, offset: 30999}, expr: &ruleRefExpr{ - pos: position{line: 981, col: 17, offset: 33254}, + pos: position{line: 912, col: 17, offset: 31000}, name: "Attributes", }, }, }, &andCodeExpr{ - pos: position{line: 981, col: 30, offset: 33267}, + pos: position{line: 912, col: 30, offset: 31013}, run: (*parser).callonRawParagraph28, }, ¬Expr{ - pos: position{line: 988, col: 7, offset: 33546}, + pos: position{line: 919, col: 7, offset: 31292}, expr: &ruleRefExpr{ - pos: position{line: 988, col: 8, offset: 33547}, + pos: position{line: 919, col: 8, offset: 31293}, name: "BlockDelimiter", }, }, &labeledExpr{ - pos: position{line: 988, col: 23, offset: 33562}, + pos: position{line: 919, col: 23, offset: 31308}, label: "content", expr: &oneOrMoreExpr{ - pos: position{line: 988, col: 31, offset: 33570}, + pos: position{line: 919, col: 31, offset: 31316}, expr: &ruleRefExpr{ - pos: position{line: 988, col: 32, offset: 33571}, + pos: position{line: 919, col: 32, offset: 31317}, name: "RawParagraphLine", }, }, @@ -7055,43 +6531,43 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 992, col: 5, offset: 33754}, + pos: position{line: 923, col: 5, offset: 31500}, run: (*parser).callonRawParagraph34, expr: &seqExpr{ - pos: position{line: 992, col: 5, offset: 33754}, + pos: position{line: 923, col: 5, offset: 31500}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 992, col: 5, offset: 33754}, + pos: position{line: 923, col: 5, offset: 31500}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 992, col: 16, offset: 33765}, + pos: position{line: 923, col: 16, offset: 31511}, expr: &ruleRefExpr{ - pos: position{line: 992, col: 17, offset: 33766}, + pos: position{line: 923, col: 17, offset: 31512}, name: "Attributes", }, }, }, ¬Expr{ - pos: position{line: 992, col: 30, offset: 33779}, + pos: position{line: 923, col: 30, offset: 31525}, expr: &ruleRefExpr{ - pos: position{line: 992, col: 31, offset: 33780}, + pos: position{line: 923, col: 31, offset: 31526}, name: "BlockDelimiter", }, }, &labeledExpr{ - pos: position{line: 992, col: 46, offset: 33795}, + pos: position{line: 923, col: 46, offset: 31541}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 992, col: 52, offset: 33801}, + pos: position{line: 923, col: 52, offset: 31547}, expr: &choiceExpr{ - pos: position{line: 992, col: 53, offset: 33802}, + pos: position{line: 923, col: 53, offset: 31548}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 992, col: 53, offset: 33802}, + pos: position{line: 923, col: 53, offset: 31548}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 992, col: 73, offset: 33822}, + pos: position{line: 923, col: 73, offset: 31568}, name: "RawParagraphLine", }, }, @@ -7106,36 +6582,36 @@ var g = &grammar{ }, { name: "MarkdownQuoteBlockRawContent", - pos: position{line: 996, col: 1, offset: 33920}, + pos: position{line: 927, col: 1, offset: 31666}, expr: &oneOrMoreExpr{ - pos: position{line: 996, col: 33, offset: 33952}, + pos: position{line: 927, col: 33, offset: 31698}, expr: &actionExpr{ - pos: position{line: 996, col: 34, offset: 33953}, + pos: position{line: 927, col: 34, offset: 31699}, run: (*parser).callonMarkdownQuoteBlockRawContent2, expr: &seqExpr{ - pos: position{line: 996, col: 34, offset: 33953}, + pos: position{line: 927, col: 34, offset: 31699}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 996, col: 34, offset: 33953}, + pos: position{line: 927, col: 34, offset: 31699}, expr: &ruleRefExpr{ - pos: position{line: 996, col: 35, offset: 33954}, + pos: position{line: 927, col: 35, offset: 31700}, name: "BlankLine", }, }, &zeroOrOneExpr{ - pos: position{line: 996, col: 45, offset: 33964}, + pos: position{line: 927, col: 45, offset: 31710}, expr: &litMatcher{ - pos: position{line: 996, col: 45, offset: 33964}, + pos: position{line: 927, col: 45, offset: 31710}, val: "> ", ignoreCase: false, want: "\"> \"", }, }, &labeledExpr{ - pos: position{line: 996, col: 51, offset: 33970}, + pos: position{line: 927, col: 51, offset: 31716}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 996, col: 60, offset: 33979}, + pos: position{line: 927, col: 60, offset: 31725}, name: "RawLine", }, }, @@ -7146,27 +6622,27 @@ var g = &grammar{ }, { name: "RawParagraphLine", - pos: position{line: 1000, col: 1, offset: 34112}, + pos: position{line: 931, col: 1, offset: 31858}, expr: &actionExpr{ - pos: position{line: 1001, col: 5, offset: 34137}, + pos: position{line: 932, col: 5, offset: 31883}, run: (*parser).callonRawParagraphLine1, expr: &seqExpr{ - pos: position{line: 1001, col: 5, offset: 34137}, + pos: position{line: 932, col: 5, offset: 31883}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1001, col: 5, offset: 34137}, + pos: position{line: 932, col: 5, offset: 31883}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1001, col: 14, offset: 34146}, + pos: position{line: 932, col: 14, offset: 31892}, name: "RawParagraphLineContent", }, }, &ruleRefExpr{ - pos: position{line: 1001, col: 39, offset: 34171}, + pos: position{line: 932, col: 39, offset: 31917}, name: "EOL", }, &andCodeExpr{ - pos: position{line: 1001, col: 43, offset: 34175}, + pos: position{line: 932, col: 43, offset: 31921}, run: (*parser).callonRawParagraphLine6, }, }, @@ -7175,14 +6651,14 @@ var g = &grammar{ }, { name: "RawParagraphLineContent", - pos: position{line: 1011, col: 1, offset: 34410}, + pos: position{line: 942, col: 1, offset: 32156}, expr: &actionExpr{ - pos: position{line: 1011, col: 28, offset: 34437}, + pos: position{line: 942, col: 28, offset: 32183}, run: (*parser).callonRawParagraphLineContent1, expr: &oneOrMoreExpr{ - pos: position{line: 1011, col: 28, offset: 34437}, + pos: position{line: 942, col: 28, offset: 32183}, expr: &charClassMatcher{ - pos: position{line: 1011, col: 28, offset: 34437}, + pos: position{line: 942, col: 28, offset: 32183}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -7193,50 +6669,50 @@ var g = &grammar{ }, { name: "SimpleRawParagraph", - pos: position{line: 1016, col: 1, offset: 34554}, + pos: position{line: 947, col: 1, offset: 32300}, expr: &actionExpr{ - pos: position{line: 1016, col: 23, offset: 34576}, + pos: position{line: 947, col: 23, offset: 32322}, run: (*parser).callonSimpleRawParagraph1, expr: &seqExpr{ - pos: position{line: 1016, col: 23, offset: 34576}, + pos: position{line: 947, col: 23, offset: 32322}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1016, col: 23, offset: 34576}, + pos: position{line: 947, col: 23, offset: 32322}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1016, col: 34, offset: 34587}, + pos: position{line: 947, col: 34, offset: 32333}, expr: &ruleRefExpr{ - pos: position{line: 1016, col: 35, offset: 34588}, + pos: position{line: 947, col: 35, offset: 32334}, name: "Attributes", }, }, }, &andCodeExpr{ - pos: position{line: 1017, col: 5, offset: 34606}, + pos: position{line: 948, col: 5, offset: 32352}, run: (*parser).callonSimpleRawParagraph6, }, &labeledExpr{ - pos: position{line: 1025, col: 5, offset: 34892}, + pos: position{line: 956, col: 5, offset: 32638}, label: "firstLine", expr: &ruleRefExpr{ - pos: position{line: 1025, col: 16, offset: 34903}, + pos: position{line: 956, col: 16, offset: 32649}, name: "FirstParagraphRawLine", }, }, &labeledExpr{ - pos: position{line: 1026, col: 5, offset: 34929}, + pos: position{line: 957, col: 5, offset: 32675}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 1026, col: 16, offset: 34940}, + pos: position{line: 957, col: 16, offset: 32686}, expr: &choiceExpr{ - pos: position{line: 1026, col: 17, offset: 34941}, + pos: position{line: 957, col: 17, offset: 32687}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1026, col: 17, offset: 34941}, + pos: position{line: 957, col: 17, offset: 32687}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 1026, col: 37, offset: 34961}, + pos: position{line: 957, col: 37, offset: 32707}, name: "RawParagraphLine", }, }, @@ -7249,34 +6725,34 @@ var g = &grammar{ }, { name: "FirstParagraphRawLine", - pos: position{line: 1030, col: 1, offset: 35093}, + pos: position{line: 961, col: 1, offset: 32839}, expr: &actionExpr{ - pos: position{line: 1031, col: 5, offset: 35123}, + pos: position{line: 962, col: 5, offset: 32869}, run: (*parser).callonFirstParagraphRawLine1, expr: &seqExpr{ - pos: position{line: 1031, col: 5, offset: 35123}, + pos: position{line: 962, col: 5, offset: 32869}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1031, col: 5, offset: 35123}, + pos: position{line: 962, col: 5, offset: 32869}, label: "content", expr: &actionExpr{ - pos: position{line: 1031, col: 14, offset: 35132}, + pos: position{line: 962, col: 14, offset: 32878}, run: (*parser).callonFirstParagraphRawLine4, expr: &seqExpr{ - pos: position{line: 1031, col: 14, offset: 35132}, + pos: position{line: 962, col: 14, offset: 32878}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1031, col: 14, offset: 35132}, + pos: position{line: 962, col: 14, offset: 32878}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1031, col: 23, offset: 35141}, + pos: position{line: 962, col: 23, offset: 32887}, name: "Word", }, }, &zeroOrMoreExpr{ - pos: position{line: 1031, col: 28, offset: 35146}, + pos: position{line: 962, col: 28, offset: 32892}, expr: &charClassMatcher{ - pos: position{line: 1031, col: 28, offset: 35146}, + pos: position{line: 962, col: 28, offset: 32892}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -7288,7 +6764,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1031, col: 68, offset: 35186}, + pos: position{line: 962, col: 68, offset: 32932}, name: "EOL", }, }, @@ -7297,48 +6773,48 @@ var g = &grammar{ }, { name: "Paragraph", - pos: position{line: 1037, col: 1, offset: 35394}, + pos: position{line: 968, col: 1, offset: 33140}, expr: &choiceExpr{ - pos: position{line: 1039, col: 5, offset: 35441}, + pos: position{line: 970, col: 5, offset: 33187}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1039, col: 5, offset: 35441}, + pos: position{line: 970, col: 5, offset: 33187}, run: (*parser).callonParagraph2, expr: &seqExpr{ - pos: position{line: 1039, col: 5, offset: 35441}, + pos: position{line: 970, col: 5, offset: 33187}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1039, col: 5, offset: 35441}, + pos: position{line: 970, col: 5, offset: 33187}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1039, col: 16, offset: 35452}, + pos: position{line: 970, col: 16, offset: 33198}, expr: &ruleRefExpr{ - pos: position{line: 1039, col: 17, offset: 35453}, + pos: position{line: 970, col: 17, offset: 33199}, name: "Attributes", }, }, }, &labeledExpr{ - pos: position{line: 1039, col: 30, offset: 35466}, + pos: position{line: 970, col: 30, offset: 33212}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 1039, col: 33, offset: 35469}, + pos: position{line: 970, col: 33, offset: 33215}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 1039, col: 49, offset: 35485}, + pos: position{line: 970, col: 49, offset: 33231}, val: ": ", ignoreCase: false, want: "\": \"", }, &labeledExpr{ - pos: position{line: 1039, col: 54, offset: 35490}, + pos: position{line: 970, col: 54, offset: 33236}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 1039, col: 60, offset: 35496}, + pos: position{line: 970, col: 60, offset: 33242}, expr: &ruleRefExpr{ - pos: position{line: 1039, col: 61, offset: 35497}, + pos: position{line: 970, col: 61, offset: 33243}, name: "ParagraphLine", }, }, @@ -7347,40 +6823,40 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1043, col: 5, offset: 35683}, + pos: position{line: 974, col: 5, offset: 33429}, run: (*parser).callonParagraph13, expr: &seqExpr{ - pos: position{line: 1043, col: 5, offset: 35683}, + pos: position{line: 974, col: 5, offset: 33429}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1043, col: 5, offset: 35683}, + pos: position{line: 974, col: 5, offset: 33429}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1043, col: 16, offset: 35694}, + pos: position{line: 974, col: 16, offset: 33440}, expr: &ruleRefExpr{ - pos: position{line: 1043, col: 17, offset: 35695}, + pos: position{line: 974, col: 17, offset: 33441}, name: "Attributes", }, }, }, &andCodeExpr{ - pos: position{line: 1043, col: 30, offset: 35708}, + pos: position{line: 974, col: 30, offset: 33454}, run: (*parser).callonParagraph18, }, ¬Expr{ - pos: position{line: 1050, col: 7, offset: 35987}, + pos: position{line: 981, col: 7, offset: 33733}, expr: &ruleRefExpr{ - pos: position{line: 1050, col: 8, offset: 35988}, + pos: position{line: 981, col: 8, offset: 33734}, name: "BlockDelimiter", }, }, &labeledExpr{ - pos: position{line: 1050, col: 23, offset: 36003}, + pos: position{line: 981, col: 23, offset: 33749}, label: "content", expr: &oneOrMoreExpr{ - pos: position{line: 1050, col: 31, offset: 36011}, + pos: position{line: 981, col: 31, offset: 33757}, expr: &ruleRefExpr{ - pos: position{line: 1050, col: 32, offset: 36012}, + pos: position{line: 981, col: 32, offset: 33758}, name: "ParagraphLine", }, }, @@ -7389,36 +6865,36 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1054, col: 5, offset: 36192}, + pos: position{line: 985, col: 5, offset: 33938}, run: (*parser).callonParagraph24, expr: &seqExpr{ - pos: position{line: 1054, col: 5, offset: 36192}, + pos: position{line: 985, col: 5, offset: 33938}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1054, col: 5, offset: 36192}, + pos: position{line: 985, col: 5, offset: 33938}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1054, col: 16, offset: 36203}, + pos: position{line: 985, col: 16, offset: 33949}, expr: &ruleRefExpr{ - pos: position{line: 1054, col: 17, offset: 36204}, + pos: position{line: 985, col: 17, offset: 33950}, name: "Attributes", }, }, }, ¬Expr{ - pos: position{line: 1054, col: 30, offset: 36217}, + pos: position{line: 985, col: 30, offset: 33963}, expr: &ruleRefExpr{ - pos: position{line: 1054, col: 31, offset: 36218}, + pos: position{line: 985, col: 31, offset: 33964}, name: "BlockDelimiter", }, }, &labeledExpr{ - pos: position{line: 1054, col: 46, offset: 36233}, + pos: position{line: 985, col: 46, offset: 33979}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 1054, col: 52, offset: 36239}, + pos: position{line: 985, col: 52, offset: 33985}, expr: &ruleRefExpr{ - pos: position{line: 1054, col: 53, offset: 36240}, + pos: position{line: 985, col: 53, offset: 33986}, name: "ParagraphLine", }, }, @@ -7431,37 +6907,37 @@ var g = &grammar{ }, { name: "ParagraphLine", - pos: position{line: 1058, col: 1, offset: 36335}, + pos: position{line: 989, col: 1, offset: 34081}, expr: &ruleRefExpr{ - pos: position{line: 1058, col: 18, offset: 36352}, + pos: position{line: 989, col: 18, offset: 34098}, name: "InlineElements", }, }, { name: "MarkdownQuoteBlockAttribution", - pos: position{line: 1060, col: 1, offset: 36368}, + pos: position{line: 991, col: 1, offset: 34114}, expr: &actionExpr{ - pos: position{line: 1060, col: 34, offset: 36401}, + pos: position{line: 991, col: 34, offset: 34147}, run: (*parser).callonMarkdownQuoteBlockAttribution1, expr: &seqExpr{ - pos: position{line: 1060, col: 34, offset: 36401}, + pos: position{line: 991, col: 34, offset: 34147}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1060, col: 34, offset: 36401}, + pos: position{line: 991, col: 34, offset: 34147}, val: "-- ", ignoreCase: false, want: "\"-- \"", }, &labeledExpr{ - pos: position{line: 1060, col: 40, offset: 36407}, + pos: position{line: 991, col: 40, offset: 34153}, label: "author", expr: &actionExpr{ - pos: position{line: 1060, col: 48, offset: 36415}, + pos: position{line: 991, col: 48, offset: 34161}, run: (*parser).callonMarkdownQuoteBlockAttribution5, expr: &oneOrMoreExpr{ - pos: position{line: 1060, col: 49, offset: 36416}, + pos: position{line: 991, col: 49, offset: 34162}, expr: &charClassMatcher{ - pos: position{line: 1060, col: 49, offset: 36416}, + pos: position{line: 991, col: 49, offset: 34162}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -7471,7 +6947,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1062, col: 8, offset: 36466}, + pos: position{line: 993, col: 8, offset: 34212}, name: "EOL", }, }, @@ -7480,27 +6956,27 @@ var g = &grammar{ }, { name: "OpenPassthroughParagraphContent", - pos: position{line: 1067, col: 1, offset: 36515}, + pos: position{line: 998, col: 1, offset: 34261}, expr: &oneOrMoreExpr{ - pos: position{line: 1067, col: 36, offset: 36550}, + pos: position{line: 998, col: 36, offset: 34296}, expr: &actionExpr{ - pos: position{line: 1067, col: 37, offset: 36551}, + pos: position{line: 998, col: 37, offset: 34297}, run: (*parser).callonOpenPassthroughParagraphContent2, expr: &seqExpr{ - pos: position{line: 1067, col: 37, offset: 36551}, + pos: position{line: 998, col: 37, offset: 34297}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1067, col: 37, offset: 36551}, + pos: position{line: 998, col: 37, offset: 34297}, expr: &ruleRefExpr{ - pos: position{line: 1067, col: 38, offset: 36552}, + pos: position{line: 998, col: 38, offset: 34298}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 1067, col: 48, offset: 36562}, + pos: position{line: 998, col: 48, offset: 34308}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1067, col: 57, offset: 36571}, + pos: position{line: 998, col: 57, offset: 34317}, name: "VerbatimContent", }, }, @@ -7511,46 +6987,46 @@ var g = &grammar{ }, { name: "ContinuedRawParagraph", - pos: position{line: 1076, col: 1, offset: 36906}, + pos: position{line: 1007, col: 1, offset: 34652}, expr: &choiceExpr{ - pos: position{line: 1078, col: 5, offset: 36965}, + pos: position{line: 1009, col: 5, offset: 34711}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1078, col: 5, offset: 36965}, + pos: position{line: 1009, col: 5, offset: 34711}, run: (*parser).callonContinuedRawParagraph2, expr: &seqExpr{ - pos: position{line: 1078, col: 5, offset: 36965}, + pos: position{line: 1009, col: 5, offset: 34711}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1078, col: 5, offset: 36965}, + pos: position{line: 1009, col: 5, offset: 34711}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1078, col: 16, offset: 36976}, + pos: position{line: 1009, col: 16, offset: 34722}, expr: &ruleRefExpr{ - pos: position{line: 1078, col: 17, offset: 36977}, + pos: position{line: 1009, col: 17, offset: 34723}, name: "Attributes", }, }, }, &labeledExpr{ - pos: position{line: 1078, col: 30, offset: 36990}, + pos: position{line: 1009, col: 30, offset: 34736}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 1078, col: 33, offset: 36993}, + pos: position{line: 1009, col: 33, offset: 34739}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 1078, col: 49, offset: 37009}, + pos: position{line: 1009, col: 49, offset: 34755}, val: ": ", ignoreCase: false, want: "\": \"", }, &labeledExpr{ - pos: position{line: 1078, col: 54, offset: 37014}, + pos: position{line: 1009, col: 54, offset: 34760}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 1078, col: 61, offset: 37021}, + pos: position{line: 1009, col: 61, offset: 34767}, name: "ContinuedRawParagraphLines", }, }, @@ -7558,27 +7034,27 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1082, col: 5, offset: 37224}, + pos: position{line: 1013, col: 5, offset: 34970}, run: (*parser).callonContinuedRawParagraph12, expr: &seqExpr{ - pos: position{line: 1082, col: 5, offset: 37224}, + pos: position{line: 1013, col: 5, offset: 34970}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1082, col: 5, offset: 37224}, + pos: position{line: 1013, col: 5, offset: 34970}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1082, col: 16, offset: 37235}, + pos: position{line: 1013, col: 16, offset: 34981}, expr: &ruleRefExpr{ - pos: position{line: 1082, col: 17, offset: 37236}, + pos: position{line: 1013, col: 17, offset: 34982}, name: "Attributes", }, }, }, &labeledExpr{ - pos: position{line: 1082, col: 30, offset: 37249}, + pos: position{line: 1013, col: 30, offset: 34995}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 1082, col: 37, offset: 37256}, + pos: position{line: 1013, col: 37, offset: 35002}, name: "ContinuedRawParagraphLines", }, }, @@ -7590,46 +7066,54 @@ var g = &grammar{ }, { name: "ContinuedRawParagraphLines", - pos: position{line: 1086, col: 1, offset: 37360}, + pos: position{line: 1017, col: 1, offset: 35106}, expr: &actionExpr{ - pos: position{line: 1086, col: 31, offset: 37390}, + pos: position{line: 1017, col: 31, offset: 35136}, run: (*parser).callonContinuedRawParagraphLines1, expr: &seqExpr{ - pos: position{line: 1086, col: 31, offset: 37390}, + pos: position{line: 1017, col: 31, offset: 35136}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1086, col: 31, offset: 37390}, + pos: position{line: 1017, col: 31, offset: 35136}, label: "firstLine", expr: &ruleRefExpr{ - pos: position{line: 1086, col: 42, offset: 37401}, + pos: position{line: 1017, col: 42, offset: 35147}, name: "FirstParagraphRawLine", }, }, &labeledExpr{ - pos: position{line: 1086, col: 65, offset: 37424}, + pos: position{line: 1017, col: 65, offset: 35170}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 1086, col: 76, offset: 37435}, - expr: &seqExpr{ - pos: position{line: 1086, col: 77, offset: 37436}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1086, col: 77, offset: 37436}, - expr: &ruleRefExpr{ - pos: position{line: 1086, col: 78, offset: 37437}, - name: "ListItemContinuation", - }, - }, - &choiceExpr{ - pos: position{line: 1086, col: 100, offset: 37459}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1086, col: 100, offset: 37459}, - name: "SingleLineComment", + pos: position{line: 1017, col: 76, offset: 35181}, + expr: &actionExpr{ + pos: position{line: 1017, col: 77, offset: 35182}, + run: (*parser).callonContinuedRawParagraphLines7, + expr: &seqExpr{ + pos: position{line: 1017, col: 77, offset: 35182}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1017, col: 77, offset: 35182}, + expr: &ruleRefExpr{ + pos: position{line: 1017, col: 78, offset: 35183}, + name: "ListItemContinuation", }, - &ruleRefExpr{ - pos: position{line: 1086, col: 120, offset: 37479}, - name: "RawParagraphLine", + }, + &labeledExpr{ + pos: position{line: 1017, col: 99, offset: 35204}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1017, col: 105, offset: 35210}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1017, col: 105, offset: 35210}, + name: "SingleLineComment", + }, + &ruleRefExpr{ + pos: position{line: 1017, col: 125, offset: 35230}, + name: "RawParagraphLine", + }, + }, }, }, }, @@ -7643,35 +7127,35 @@ var g = &grammar{ }, { name: "RawVerseParagraph", - pos: position{line: 1094, col: 1, offset: 37697}, + pos: position{line: 1025, col: 1, offset: 35469}, expr: &actionExpr{ - pos: position{line: 1095, col: 5, offset: 37723}, + pos: position{line: 1026, col: 5, offset: 35495}, run: (*parser).callonRawVerseParagraph1, expr: &seqExpr{ - pos: position{line: 1095, col: 5, offset: 37723}, + pos: position{line: 1026, col: 5, offset: 35495}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1095, col: 5, offset: 37723}, + pos: position{line: 1026, col: 5, offset: 35495}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1095, col: 16, offset: 37734}, + pos: position{line: 1026, col: 16, offset: 35506}, expr: &ruleRefExpr{ - pos: position{line: 1095, col: 17, offset: 37735}, + pos: position{line: 1026, col: 17, offset: 35507}, name: "Attributes", }, }, }, &andCodeExpr{ - pos: position{line: 1096, col: 5, offset: 37752}, + pos: position{line: 1027, col: 5, offset: 35524}, run: (*parser).callonRawVerseParagraph6, }, &labeledExpr{ - pos: position{line: 1103, col: 5, offset: 37957}, + pos: position{line: 1034, col: 5, offset: 35729}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 1103, col: 11, offset: 37963}, + pos: position{line: 1034, col: 11, offset: 35735}, expr: &ruleRefExpr{ - pos: position{line: 1103, col: 12, offset: 37964}, + pos: position{line: 1034, col: 12, offset: 35736}, name: "RawLine", }, }, @@ -7682,57 +7166,57 @@ var g = &grammar{ }, { name: "InlineElements", - pos: position{line: 1111, col: 1, offset: 38170}, + pos: position{line: 1042, col: 1, offset: 35942}, expr: &actionExpr{ - pos: position{line: 1111, col: 19, offset: 38188}, + pos: position{line: 1042, col: 19, offset: 35960}, run: (*parser).callonInlineElements1, expr: &seqExpr{ - pos: position{line: 1111, col: 19, offset: 38188}, + pos: position{line: 1042, col: 19, offset: 35960}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1111, col: 19, offset: 38188}, + pos: position{line: 1042, col: 19, offset: 35960}, expr: &ruleRefExpr{ - pos: position{line: 1111, col: 20, offset: 38189}, + pos: position{line: 1042, col: 20, offset: 35961}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 1112, col: 5, offset: 38203}, + pos: position{line: 1043, col: 5, offset: 35975}, label: "elements", expr: &choiceExpr{ - pos: position{line: 1112, col: 15, offset: 38213}, + pos: position{line: 1043, col: 15, offset: 35985}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1112, col: 15, offset: 38213}, + pos: position{line: 1043, col: 15, offset: 35985}, run: (*parser).callonInlineElements7, expr: &labeledExpr{ - pos: position{line: 1112, col: 15, offset: 38213}, + pos: position{line: 1043, col: 15, offset: 35985}, label: "comment", expr: &ruleRefExpr{ - pos: position{line: 1112, col: 24, offset: 38222}, + pos: position{line: 1043, col: 24, offset: 35994}, name: "SingleLineComment", }, }, }, &actionExpr{ - pos: position{line: 1114, col: 9, offset: 38314}, + pos: position{line: 1045, col: 9, offset: 36086}, run: (*parser).callonInlineElements10, expr: &seqExpr{ - pos: position{line: 1114, col: 9, offset: 38314}, + pos: position{line: 1045, col: 9, offset: 36086}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1114, col: 9, offset: 38314}, + pos: position{line: 1045, col: 9, offset: 36086}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1114, col: 18, offset: 38323}, + pos: position{line: 1045, col: 18, offset: 36095}, expr: &ruleRefExpr{ - pos: position{line: 1114, col: 19, offset: 38324}, + pos: position{line: 1045, col: 19, offset: 36096}, name: "InlineElement", }, }, }, &ruleRefExpr{ - pos: position{line: 1114, col: 35, offset: 38340}, + pos: position{line: 1045, col: 35, offset: 36112}, name: "EOL", }, }, @@ -7747,110 +7231,114 @@ var g = &grammar{ }, { name: "InlineElement", - pos: position{line: 1120, col: 1, offset: 38457}, + pos: position{line: 1051, col: 1, offset: 36229}, expr: &actionExpr{ - pos: position{line: 1121, col: 5, offset: 38480}, + pos: position{line: 1052, col: 5, offset: 36252}, run: (*parser).callonInlineElement1, expr: &labeledExpr{ - pos: position{line: 1121, col: 5, offset: 38480}, + pos: position{line: 1052, col: 5, offset: 36252}, label: "element", expr: &choiceExpr{ - pos: position{line: 1121, col: 14, offset: 38489}, + pos: position{line: 1052, col: 14, offset: 36261}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1121, col: 14, offset: 38489}, + pos: position{line: 1052, col: 14, offset: 36261}, name: "InlineWord", }, &ruleRefExpr{ - pos: position{line: 1122, col: 11, offset: 38540}, + pos: position{line: 1053, col: 11, offset: 36322}, name: "LineBreak", }, &oneOrMoreExpr{ - pos: position{line: 1123, col: 11, offset: 38585}, + pos: position{line: 1054, col: 11, offset: 36367}, expr: &ruleRefExpr{ - pos: position{line: 1123, col: 11, offset: 38585}, + pos: position{line: 1054, col: 11, offset: 36367}, name: "Space", }, }, &seqExpr{ - pos: position{line: 1124, col: 11, offset: 38603}, + pos: position{line: 1055, col: 11, offset: 36385}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1124, col: 11, offset: 38603}, + pos: position{line: 1055, col: 11, offset: 36385}, expr: &ruleRefExpr{ - pos: position{line: 1124, col: 12, offset: 38604}, + pos: position{line: 1055, col: 12, offset: 36386}, name: "EOL", }, }, &choiceExpr{ - pos: position{line: 1125, col: 13, offset: 38622}, + pos: position{line: 1056, col: 13, offset: 36404}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1125, col: 13, offset: 38622}, + pos: position{line: 1056, col: 13, offset: 36404}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 1126, col: 15, offset: 38649}, + pos: position{line: 1057, col: 15, offset: 36431}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1127, col: 15, offset: 38674}, + pos: position{line: 1058, col: 15, offset: 36456}, name: "InlineIcon", }, &ruleRefExpr{ - pos: position{line: 1128, col: 15, offset: 38699}, + pos: position{line: 1059, col: 15, offset: 36481}, name: "InlineImage", }, &ruleRefExpr{ - pos: position{line: 1129, col: 15, offset: 38726}, + pos: position{line: 1060, col: 15, offset: 36508}, name: "Link", }, &ruleRefExpr{ - pos: position{line: 1130, col: 15, offset: 38746}, + pos: position{line: 1061, col: 15, offset: 36528}, name: "InlinePassthrough", }, &ruleRefExpr{ - pos: position{line: 1131, col: 15, offset: 38839}, + pos: position{line: 1062, col: 15, offset: 36621}, name: "InlineFootnote", }, &ruleRefExpr{ - pos: position{line: 1132, col: 15, offset: 38869}, + pos: position{line: 1063, col: 15, offset: 36651}, name: "CrossReference", }, &ruleRefExpr{ - pos: position{line: 1133, col: 15, offset: 38899}, + pos: position{line: 1064, col: 15, offset: 36719}, name: "SpecialCharacter", }, &ruleRefExpr{ - pos: position{line: 1134, col: 15, offset: 38930}, + pos: position{line: 1065, col: 15, offset: 36750}, name: "Symbol", }, &ruleRefExpr{ - pos: position{line: 1135, col: 15, offset: 38951}, + pos: position{line: 1066, col: 15, offset: 36771}, name: "InlineUserMacro", }, &ruleRefExpr{ - pos: position{line: 1136, col: 15, offset: 38982}, + pos: position{line: 1067, col: 15, offset: 36802}, name: "AttributeSubstitution", }, &ruleRefExpr{ - pos: position{line: 1137, col: 15, offset: 39019}, + pos: position{line: 1068, col: 15, offset: 36839}, name: "InlineElementID", }, &ruleRefExpr{ - pos: position{line: 1138, col: 15, offset: 39049}, + pos: position{line: 1069, col: 15, offset: 36869}, name: "ConcealedIndexTerm", }, &ruleRefExpr{ - pos: position{line: 1139, col: 15, offset: 39082}, + pos: position{line: 1070, col: 15, offset: 36902}, name: "IndexTerm", }, &ruleRefExpr{ - pos: position{line: 1140, col: 15, offset: 39106}, + pos: position{line: 1071, col: 15, offset: 36926}, name: "ImpliedApostrophe", }, &ruleRefExpr{ - pos: position{line: 1141, col: 15, offset: 39138}, + pos: position{line: 1072, col: 15, offset: 36958}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1073, col: 15, offset: 36991}, name: "AnyChar", }, }, @@ -7864,34 +7352,34 @@ var g = &grammar{ }, { name: "LineBreak", - pos: position{line: 1148, col: 1, offset: 39361}, + pos: position{line: 1080, col: 1, offset: 37214}, expr: &actionExpr{ - pos: position{line: 1148, col: 14, offset: 39374}, + pos: position{line: 1080, col: 14, offset: 37227}, run: (*parser).callonLineBreak1, expr: &seqExpr{ - pos: position{line: 1148, col: 14, offset: 39374}, + pos: position{line: 1080, col: 14, offset: 37227}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1148, col: 14, offset: 39374}, + pos: position{line: 1080, col: 14, offset: 37227}, name: "Space", }, &litMatcher{ - pos: position{line: 1148, col: 20, offset: 39380}, + pos: position{line: 1080, col: 20, offset: 37233}, val: "+", ignoreCase: false, want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 1148, col: 24, offset: 39384}, + pos: position{line: 1080, col: 24, offset: 37237}, expr: &ruleRefExpr{ - pos: position{line: 1148, col: 24, offset: 39384}, + pos: position{line: 1080, col: 24, offset: 37237}, name: "Space", }, }, &andExpr{ - pos: position{line: 1148, col: 31, offset: 39391}, + pos: position{line: 1080, col: 31, offset: 37244}, expr: &ruleRefExpr{ - pos: position{line: 1148, col: 32, offset: 39392}, + pos: position{line: 1080, col: 32, offset: 37245}, name: "EOL", }, }, @@ -7901,20 +7389,20 @@ var g = &grammar{ }, { name: "QuotedText", - pos: position{line: 1155, col: 1, offset: 39676}, + pos: position{line: 1087, col: 1, offset: 37529}, expr: &choiceExpr{ - pos: position{line: 1155, col: 15, offset: 39690}, + pos: position{line: 1087, col: 15, offset: 37543}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1155, col: 15, offset: 39690}, + pos: position{line: 1087, col: 15, offset: 37543}, name: "UnconstrainedQuotedText", }, &ruleRefExpr{ - pos: position{line: 1155, col: 41, offset: 39716}, + pos: position{line: 1087, col: 41, offset: 37569}, name: "ConstrainedQuotedText", }, &ruleRefExpr{ - pos: position{line: 1155, col: 65, offset: 39740}, + pos: position{line: 1087, col: 65, offset: 37593}, name: "EscapedQuotedText", }, }, @@ -7922,23 +7410,23 @@ var g = &grammar{ }, { name: "ConstrainedQuotedTextMarker", - pos: position{line: 1157, col: 1, offset: 39759}, + pos: position{line: 1089, col: 1, offset: 37612}, expr: &choiceExpr{ - pos: position{line: 1157, col: 32, offset: 39790}, + pos: position{line: 1089, col: 32, offset: 37643}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1157, col: 32, offset: 39790}, + pos: position{line: 1089, col: 32, offset: 37643}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1157, col: 32, offset: 39790}, + pos: position{line: 1089, col: 32, offset: 37643}, val: "*", ignoreCase: false, want: "\"*\"", }, ¬Expr{ - pos: position{line: 1157, col: 36, offset: 39794}, + pos: position{line: 1089, col: 36, offset: 37647}, expr: &litMatcher{ - pos: position{line: 1157, col: 37, offset: 39795}, + pos: position{line: 1089, col: 37, offset: 37648}, val: "*", ignoreCase: false, want: "\"*\"", @@ -7947,18 +7435,18 @@ var g = &grammar{ }, }, &seqExpr{ - pos: position{line: 1157, col: 43, offset: 39801}, + pos: position{line: 1089, col: 43, offset: 37654}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1157, col: 43, offset: 39801}, + pos: position{line: 1089, col: 43, offset: 37654}, val: "_", ignoreCase: false, want: "\"_\"", }, ¬Expr{ - pos: position{line: 1157, col: 47, offset: 39805}, + pos: position{line: 1089, col: 47, offset: 37658}, expr: &litMatcher{ - pos: position{line: 1157, col: 48, offset: 39806}, + pos: position{line: 1089, col: 48, offset: 37659}, val: "_", ignoreCase: false, want: "\"_\"", @@ -7967,18 +7455,18 @@ var g = &grammar{ }, }, &seqExpr{ - pos: position{line: 1157, col: 54, offset: 39812}, + pos: position{line: 1089, col: 54, offset: 37665}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1157, col: 54, offset: 39812}, + pos: position{line: 1089, col: 54, offset: 37665}, val: "#", ignoreCase: false, want: "\"#\"", }, ¬Expr{ - pos: position{line: 1157, col: 58, offset: 39816}, + pos: position{line: 1089, col: 58, offset: 37669}, expr: &litMatcher{ - pos: position{line: 1157, col: 59, offset: 39817}, + pos: position{line: 1089, col: 59, offset: 37670}, val: "#", ignoreCase: false, want: "\"#\"", @@ -7987,18 +7475,18 @@ var g = &grammar{ }, }, &seqExpr{ - pos: position{line: 1157, col: 65, offset: 39823}, + pos: position{line: 1089, col: 65, offset: 37676}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1157, col: 65, offset: 39823}, + pos: position{line: 1089, col: 65, offset: 37676}, val: "`", ignoreCase: false, want: "\"`\"", }, ¬Expr{ - pos: position{line: 1157, col: 69, offset: 39827}, + pos: position{line: 1089, col: 69, offset: 37680}, expr: &litMatcher{ - pos: position{line: 1157, col: 70, offset: 39828}, + pos: position{line: 1089, col: 70, offset: 37681}, val: "`", ignoreCase: false, want: "\"`\"", @@ -8011,42 +7499,42 @@ var g = &grammar{ }, { name: "UnconstrainedQuotedTextPrefix", - pos: position{line: 1159, col: 1, offset: 39833}, + pos: position{line: 1091, col: 1, offset: 37686}, expr: &choiceExpr{ - pos: position{line: 1159, col: 34, offset: 39866}, + pos: position{line: 1091, col: 34, offset: 37719}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1159, col: 34, offset: 39866}, + pos: position{line: 1091, col: 34, offset: 37719}, val: "**", ignoreCase: false, want: "\"**\"", }, &litMatcher{ - pos: position{line: 1159, col: 41, offset: 39873}, + pos: position{line: 1091, col: 41, offset: 37726}, val: "__", ignoreCase: false, want: "\"__\"", }, &litMatcher{ - pos: position{line: 1159, col: 48, offset: 39880}, + pos: position{line: 1091, col: 48, offset: 37733}, val: "``", ignoreCase: false, want: "\"``\"", }, &litMatcher{ - pos: position{line: 1159, col: 55, offset: 39887}, + pos: position{line: 1091, col: 55, offset: 37740}, val: "##", ignoreCase: false, want: "\"##\"", }, &litMatcher{ - pos: position{line: 1159, col: 62, offset: 39894}, + pos: position{line: 1091, col: 62, offset: 37747}, val: "^", ignoreCase: false, want: "\"^\"", }, &litMatcher{ - pos: position{line: 1159, col: 68, offset: 39900}, + pos: position{line: 1091, col: 68, offset: 37753}, val: "~", ignoreCase: false, want: "\"~\"", @@ -8056,42 +7544,42 @@ var g = &grammar{ }, { name: "ConstrainedQuotedText", - pos: position{line: 1161, col: 1, offset: 39905}, + pos: position{line: 1093, col: 1, offset: 37758}, expr: &actionExpr{ - pos: position{line: 1161, col: 26, offset: 39930}, + pos: position{line: 1093, col: 26, offset: 37783}, run: (*parser).callonConstrainedQuotedText1, expr: &labeledExpr{ - pos: position{line: 1161, col: 26, offset: 39930}, + pos: position{line: 1093, col: 26, offset: 37783}, label: "text", expr: &choiceExpr{ - pos: position{line: 1161, col: 32, offset: 39936}, + pos: position{line: 1093, col: 32, offset: 37789}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1161, col: 32, offset: 39936}, + pos: position{line: 1093, col: 32, offset: 37789}, name: "SingleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 1162, col: 15, offset: 39971}, + pos: position{line: 1094, col: 15, offset: 37824}, name: "SingleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 1163, col: 15, offset: 40007}, + pos: position{line: 1095, col: 15, offset: 37860}, name: "SingleQuoteMarkedText", }, &ruleRefExpr{ - pos: position{line: 1164, col: 15, offset: 40043}, + pos: position{line: 1096, col: 15, offset: 37896}, name: "SingleQuoteMonospaceText", }, &ruleRefExpr{ - pos: position{line: 1165, col: 15, offset: 40083}, + pos: position{line: 1097, col: 15, offset: 37936}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1166, col: 15, offset: 40112}, + pos: position{line: 1098, col: 15, offset: 37965}, name: "SuperscriptText", }, &ruleRefExpr{ - pos: position{line: 1167, col: 15, offset: 40143}, + pos: position{line: 1099, col: 15, offset: 37996}, name: "SubscriptOrSuperscriptPrefix", }, }, @@ -8101,24 +7589,24 @@ var g = &grammar{ }, { name: "UnconstrainedQuotedText", - pos: position{line: 1171, col: 1, offset: 40297}, + pos: position{line: 1103, col: 1, offset: 38150}, expr: &choiceExpr{ - pos: position{line: 1171, col: 28, offset: 40324}, + pos: position{line: 1103, col: 28, offset: 38177}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1171, col: 28, offset: 40324}, + pos: position{line: 1103, col: 28, offset: 38177}, name: "DoubleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 1172, col: 15, offset: 40358}, + pos: position{line: 1104, col: 15, offset: 38211}, name: "DoubleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 1173, col: 15, offset: 40394}, + pos: position{line: 1105, col: 15, offset: 38247}, name: "DoubleQuoteMarkedText", }, &ruleRefExpr{ - pos: position{line: 1174, col: 15, offset: 40430}, + pos: position{line: 1106, col: 15, offset: 38283}, name: "DoubleQuoteMonospaceText", }, }, @@ -8126,32 +7614,32 @@ var g = &grammar{ }, { name: "EscapedQuotedText", - pos: position{line: 1176, col: 1, offset: 40456}, + pos: position{line: 1108, col: 1, offset: 38309}, expr: &choiceExpr{ - pos: position{line: 1176, col: 22, offset: 40477}, + pos: position{line: 1108, col: 22, offset: 38330}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1176, col: 22, offset: 40477}, + pos: position{line: 1108, col: 22, offset: 38330}, name: "EscapedBoldText", }, &ruleRefExpr{ - pos: position{line: 1177, col: 15, offset: 40508}, + pos: position{line: 1109, col: 15, offset: 38361}, name: "EscapedItalicText", }, &ruleRefExpr{ - pos: position{line: 1178, col: 15, offset: 40540}, + pos: position{line: 1110, col: 15, offset: 38393}, name: "EscapedMarkedText", }, &ruleRefExpr{ - pos: position{line: 1179, col: 15, offset: 40572}, + pos: position{line: 1111, col: 15, offset: 38425}, name: "EscapedMonospaceText", }, &ruleRefExpr{ - pos: position{line: 1180, col: 15, offset: 40608}, + pos: position{line: 1112, col: 15, offset: 38461}, name: "EscapedSubscriptText", }, &ruleRefExpr{ - pos: position{line: 1181, col: 15, offset: 40644}, + pos: position{line: 1113, col: 15, offset: 38497}, name: "EscapedSuperscriptText", }, }, @@ -8159,21 +7647,21 @@ var g = &grammar{ }, { name: "SubscriptOrSuperscriptPrefix", - pos: position{line: 1183, col: 1, offset: 40668}, + pos: position{line: 1115, col: 1, offset: 38521}, expr: &choiceExpr{ - pos: position{line: 1183, col: 33, offset: 40700}, + pos: position{line: 1115, col: 33, offset: 38553}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1183, col: 33, offset: 40700}, + pos: position{line: 1115, col: 33, offset: 38553}, val: "^", ignoreCase: false, want: "\"^\"", }, &actionExpr{ - pos: position{line: 1183, col: 39, offset: 40706}, + pos: position{line: 1115, col: 39, offset: 38559}, run: (*parser).callonSubscriptOrSuperscriptPrefix3, expr: &litMatcher{ - pos: position{line: 1183, col: 39, offset: 40706}, + pos: position{line: 1115, col: 39, offset: 38559}, val: "~", ignoreCase: false, want: "\"~\"", @@ -8184,14 +7672,14 @@ var g = &grammar{ }, { name: "OneOrMoreBackslashes", - pos: position{line: 1187, col: 1, offset: 40839}, + pos: position{line: 1119, col: 1, offset: 38692}, expr: &actionExpr{ - pos: position{line: 1187, col: 25, offset: 40863}, + pos: position{line: 1119, col: 25, offset: 38716}, run: (*parser).callonOneOrMoreBackslashes1, expr: &oneOrMoreExpr{ - pos: position{line: 1187, col: 25, offset: 40863}, + pos: position{line: 1119, col: 25, offset: 38716}, expr: &litMatcher{ - pos: position{line: 1187, col: 25, offset: 40863}, + pos: position{line: 1119, col: 25, offset: 38716}, val: "\\", ignoreCase: false, want: "\"\\\\\"", @@ -8201,23 +7689,23 @@ var g = &grammar{ }, { name: "TwoOrMoreBackslashes", - pos: position{line: 1191, col: 1, offset: 40904}, + pos: position{line: 1123, col: 1, offset: 38757}, expr: &actionExpr{ - pos: position{line: 1191, col: 25, offset: 40928}, + pos: position{line: 1123, col: 25, offset: 38781}, run: (*parser).callonTwoOrMoreBackslashes1, expr: &seqExpr{ - pos: position{line: 1191, col: 25, offset: 40928}, + pos: position{line: 1123, col: 25, offset: 38781}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1191, col: 25, offset: 40928}, + pos: position{line: 1123, col: 25, offset: 38781}, val: "\\\\", ignoreCase: false, want: "\"\\\\\\\\\"", }, &zeroOrMoreExpr{ - pos: position{line: 1191, col: 30, offset: 40933}, + pos: position{line: 1123, col: 30, offset: 38786}, expr: &litMatcher{ - pos: position{line: 1191, col: 30, offset: 40933}, + pos: position{line: 1123, col: 30, offset: 38786}, val: "\\", ignoreCase: false, want: "\"\\\\\"", @@ -8229,16 +7717,16 @@ var g = &grammar{ }, { name: "BoldText", - pos: position{line: 1199, col: 1, offset: 41030}, + pos: position{line: 1131, col: 1, offset: 38883}, expr: &choiceExpr{ - pos: position{line: 1199, col: 13, offset: 41042}, + pos: position{line: 1131, col: 13, offset: 38895}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1199, col: 13, offset: 41042}, + pos: position{line: 1131, col: 13, offset: 38895}, name: "DoubleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 1199, col: 35, offset: 41064}, + pos: position{line: 1131, col: 35, offset: 38917}, name: "SingleQuoteBoldText", }, }, @@ -8246,40 +7734,40 @@ var g = &grammar{ }, { name: "DoubleQuoteBoldText", - pos: position{line: 1201, col: 1, offset: 41131}, + pos: position{line: 1133, col: 1, offset: 38984}, expr: &actionExpr{ - pos: position{line: 1201, col: 24, offset: 41154}, + pos: position{line: 1133, col: 24, offset: 39007}, run: (*parser).callonDoubleQuoteBoldText1, expr: &seqExpr{ - pos: position{line: 1201, col: 24, offset: 41154}, + pos: position{line: 1133, col: 24, offset: 39007}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1201, col: 24, offset: 41154}, + pos: position{line: 1133, col: 24, offset: 39007}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1201, col: 30, offset: 41160}, + pos: position{line: 1133, col: 30, offset: 39013}, expr: &ruleRefExpr{ - pos: position{line: 1201, col: 31, offset: 41161}, + pos: position{line: 1133, col: 31, offset: 39014}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1201, col: 49, offset: 41179}, + pos: position{line: 1133, col: 49, offset: 39032}, val: "**", ignoreCase: false, want: "\"**\"", }, &labeledExpr{ - pos: position{line: 1201, col: 54, offset: 41184}, + pos: position{line: 1133, col: 54, offset: 39037}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1201, col: 64, offset: 41194}, + pos: position{line: 1133, col: 64, offset: 39047}, name: "DoubleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 1201, col: 93, offset: 41223}, + pos: position{line: 1133, col: 93, offset: 39076}, val: "**", ignoreCase: false, want: "\"**\"", @@ -8290,167 +7778,133 @@ var g = &grammar{ }, { name: "DoubleQuoteBoldTextElements", - pos: position{line: 1205, col: 1, offset: 41310}, - expr: &seqExpr{ - pos: position{line: 1205, col: 32, offset: 41341}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1205, col: 32, offset: 41341}, - name: "DoubleQuoteBoldTextElement", - }, - &zeroOrMoreExpr{ - pos: position{line: 1205, col: 59, offset: 41368}, - expr: &seqExpr{ - pos: position{line: 1205, col: 60, offset: 41369}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1205, col: 60, offset: 41369}, - expr: &litMatcher{ - pos: position{line: 1205, col: 62, offset: 41371}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - }, - &choiceExpr{ - pos: position{line: 1205, col: 69, offset: 41378}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1205, col: 69, offset: 41378}, - name: "Space", - }, - &ruleRefExpr{ - pos: position{line: 1205, col: 77, offset: 41386}, - name: "DoubleQuoteBoldTextElement", - }, - }, - }, - }, - }, - }, + pos: position{line: 1137, col: 1, offset: 39163}, + expr: &zeroOrMoreExpr{ + pos: position{line: 1137, col: 32, offset: 39194}, + expr: &ruleRefExpr{ + pos: position{line: 1137, col: 32, offset: 39194}, + name: "DoubleQuoteBoldTextElement", }, }, }, { name: "DoubleQuoteBoldTextElement", - pos: position{line: 1207, col: 1, offset: 41451}, - expr: &choiceExpr{ - pos: position{line: 1207, col: 31, offset: 41481}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1207, col: 31, offset: 41481}, - name: "Word", - }, - &seqExpr{ - pos: position{line: 1208, col: 11, offset: 41496}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1208, col: 11, offset: 41496}, - name: "Newline", + pos: position{line: 1139, col: 1, offset: 39225}, + expr: &actionExpr{ + pos: position{line: 1139, col: 31, offset: 39255}, + run: (*parser).callonDoubleQuoteBoldTextElement1, + expr: &seqExpr{ + pos: position{line: 1139, col: 31, offset: 39255}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1139, col: 31, offset: 39255}, + expr: &litMatcher{ + pos: position{line: 1139, col: 33, offset: 39257}, + val: "**", + ignoreCase: false, + want: "\"**\"", }, - ¬Expr{ - pos: position{line: 1208, col: 19, offset: 41504}, - expr: &ruleRefExpr{ - pos: position{line: 1208, col: 20, offset: 41505}, - name: "Newline", + }, + &labeledExpr{ + pos: position{line: 1139, col: 39, offset: 39263}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1139, col: 48, offset: 39272}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1139, col: 48, offset: 39272}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 1140, col: 11, offset: 39287}, + name: "Space", + }, + &seqExpr{ + pos: position{line: 1141, col: 11, offset: 39336}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1141, col: 11, offset: 39336}, + name: "Newline", + }, + ¬Expr{ + pos: position{line: 1141, col: 19, offset: 39344}, + expr: &ruleRefExpr{ + pos: position{line: 1141, col: 20, offset: 39345}, + name: "Newline", + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1142, col: 11, offset: 39363}, + name: "SingleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1143, col: 11, offset: 39393}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1144, col: 11, offset: 39416}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1145, col: 11, offset: 39437}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1146, col: 11, offset: 39458}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1147, col: 11, offset: 39482}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1148, col: 11, offset: 39506}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1157, col: 11, offset: 39791}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1158, col: 11, offset: 39820}, + name: "DoubleQuoteBoldTextFallbackCharacter", + }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1209, col: 11, offset: 41523}, - name: "SingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1210, col: 11, offset: 41553}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1211, col: 11, offset: 41576}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1212, col: 11, offset: 41597}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1213, col: 11, offset: 41618}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1214, col: 11, offset: 41642}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1215, col: 11, offset: 41666}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1216, col: 11, offset: 41692}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1217, col: 11, offset: 41781}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1218, col: 11, offset: 41808}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1219, col: 11, offset: 41825}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1220, col: 11, offset: 41846}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1221, col: 11, offset: 41868}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1222, col: 11, offset: 41883}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 1223, col: 11, offset: 41915}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 1224, col: 11, offset: 41943}, - name: "DoubleQuoteBoldTextFallbackCharacter", - }, }, }, }, { name: "DoubleQuoteBoldTextFallbackCharacter", - pos: position{line: 1227, col: 1, offset: 41982}, + pos: position{line: 1162, col: 1, offset: 39887}, expr: &choiceExpr{ - pos: position{line: 1228, col: 5, offset: 42026}, + pos: position{line: 1163, col: 5, offset: 39931}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1228, col: 5, offset: 42026}, + pos: position{line: 1163, col: 5, offset: 39931}, val: "[^\\r\\n*]", chars: []rune{'\r', '\n', '*'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1229, col: 7, offset: 42123}, + pos: position{line: 1164, col: 7, offset: 40028}, run: (*parser).callonDoubleQuoteBoldTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1229, col: 7, offset: 42123}, + pos: position{line: 1164, col: 7, offset: 40028}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1229, col: 7, offset: 42123}, + pos: position{line: 1164, col: 7, offset: 40028}, val: "**", ignoreCase: false, want: "\"**\"", }, &ruleRefExpr{ - pos: position{line: 1229, col: 12, offset: 42128}, + pos: position{line: 1164, col: 12, offset: 40033}, name: "Alphanums", }, }, @@ -8461,40 +7915,40 @@ var g = &grammar{ }, { name: "SingleQuoteBoldText", - pos: position{line: 1233, col: 1, offset: 42291}, + pos: position{line: 1168, col: 1, offset: 40196}, expr: &choiceExpr{ - pos: position{line: 1233, col: 24, offset: 42314}, + pos: position{line: 1168, col: 24, offset: 40219}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1233, col: 24, offset: 42314}, + pos: position{line: 1168, col: 24, offset: 40219}, run: (*parser).callonSingleQuoteBoldText2, expr: &seqExpr{ - pos: position{line: 1233, col: 24, offset: 42314}, + pos: position{line: 1168, col: 24, offset: 40219}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1233, col: 24, offset: 42314}, + pos: position{line: 1168, col: 24, offset: 40219}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1233, col: 30, offset: 42320}, + pos: position{line: 1168, col: 30, offset: 40225}, expr: &ruleRefExpr{ - pos: position{line: 1233, col: 31, offset: 42321}, + pos: position{line: 1168, col: 31, offset: 40226}, name: "QuotedTextAttrs", }, }, }, &seqExpr{ - pos: position{line: 1233, col: 51, offset: 42341}, + pos: position{line: 1168, col: 51, offset: 40246}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1233, col: 51, offset: 42341}, + pos: position{line: 1168, col: 51, offset: 40246}, val: "*", ignoreCase: false, want: "\"*\"", }, ¬Expr{ - pos: position{line: 1233, col: 55, offset: 42345}, + pos: position{line: 1168, col: 55, offset: 40250}, expr: &litMatcher{ - pos: position{line: 1233, col: 56, offset: 42346}, + pos: position{line: 1168, col: 56, offset: 40251}, val: "*", ignoreCase: false, want: "\"*\"", @@ -8503,25 +7957,25 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1233, col: 61, offset: 42351}, + pos: position{line: 1168, col: 61, offset: 40256}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1233, col: 71, offset: 42361}, + pos: position{line: 1168, col: 71, offset: 40266}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 1233, col: 100, offset: 42390}, + pos: position{line: 1168, col: 100, offset: 40295}, val: "*", ignoreCase: false, want: "\"*\"", }, &andExpr{ - pos: position{line: 1233, col: 104, offset: 42394}, + pos: position{line: 1168, col: 104, offset: 40299}, expr: ¬Expr{ - pos: position{line: 1233, col: 106, offset: 42396}, + pos: position{line: 1168, col: 106, offset: 40301}, expr: &ruleRefExpr{ - pos: position{line: 1233, col: 107, offset: 42397}, + pos: position{line: 1168, col: 107, offset: 40302}, name: "Alphanum", }, }, @@ -8530,49 +7984,49 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1235, col: 5, offset: 42591}, + pos: position{line: 1170, col: 5, offset: 40496}, run: (*parser).callonSingleQuoteBoldText17, expr: &seqExpr{ - pos: position{line: 1235, col: 5, offset: 42591}, + pos: position{line: 1170, col: 5, offset: 40496}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1235, col: 5, offset: 42591}, + pos: position{line: 1170, col: 5, offset: 40496}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1235, col: 11, offset: 42597}, + pos: position{line: 1170, col: 11, offset: 40502}, expr: &ruleRefExpr{ - pos: position{line: 1235, col: 12, offset: 42598}, + pos: position{line: 1170, col: 12, offset: 40503}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1235, col: 30, offset: 42616}, + pos: position{line: 1170, col: 30, offset: 40521}, val: "*", ignoreCase: false, want: "\"*\"", }, &labeledExpr{ - pos: position{line: 1235, col: 34, offset: 42620}, + pos: position{line: 1170, col: 34, offset: 40525}, label: "elements", expr: &seqExpr{ - pos: position{line: 1235, col: 44, offset: 42630}, + pos: position{line: 1170, col: 44, offset: 40535}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1235, col: 44, offset: 42630}, + pos: position{line: 1170, col: 44, offset: 40535}, val: "*", ignoreCase: false, want: "\"*\"", }, &ruleRefExpr{ - pos: position{line: 1235, col: 48, offset: 42634}, + pos: position{line: 1170, col: 48, offset: 40539}, name: "SingleQuoteBoldTextElements", }, }, }, }, &litMatcher{ - pos: position{line: 1235, col: 77, offset: 42663}, + pos: position{line: 1170, col: 77, offset: 40568}, val: "*", ignoreCase: false, want: "\"*\"", @@ -8585,21 +8039,21 @@ var g = &grammar{ }, { name: "SingleQuoteBoldTextElements", - pos: position{line: 1239, col: 1, offset: 42869}, + pos: position{line: 1174, col: 1, offset: 40774}, expr: &seqExpr{ - pos: position{line: 1239, col: 32, offset: 42900}, + pos: position{line: 1174, col: 32, offset: 40805}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1239, col: 32, offset: 42900}, + pos: position{line: 1174, col: 32, offset: 40805}, expr: &ruleRefExpr{ - pos: position{line: 1239, col: 33, offset: 42901}, + pos: position{line: 1174, col: 33, offset: 40806}, name: "Space", }, }, &oneOrMoreExpr{ - pos: position{line: 1239, col: 39, offset: 42907}, + pos: position{line: 1174, col: 39, offset: 40812}, expr: &ruleRefExpr{ - pos: position{line: 1239, col: 39, offset: 42907}, + pos: position{line: 1174, col: 39, offset: 40812}, name: "SingleQuoteBoldTextElement", }, }, @@ -8608,63 +8062,63 @@ var g = &grammar{ }, { name: "SingleQuoteBoldTextElement", - pos: position{line: 1241, col: 1, offset: 42936}, + pos: position{line: 1176, col: 1, offset: 40841}, expr: &choiceExpr{ - pos: position{line: 1241, col: 31, offset: 42966}, + pos: position{line: 1176, col: 31, offset: 40871}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1241, col: 31, offset: 42966}, + pos: position{line: 1176, col: 31, offset: 40871}, name: "Word", }, &seqExpr{ - pos: position{line: 1242, col: 11, offset: 42981}, + pos: position{line: 1177, col: 11, offset: 40886}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1242, col: 11, offset: 42981}, + pos: position{line: 1177, col: 11, offset: 40886}, name: "Newline", }, ¬Expr{ - pos: position{line: 1242, col: 19, offset: 42989}, + pos: position{line: 1177, col: 19, offset: 40894}, expr: &ruleRefExpr{ - pos: position{line: 1242, col: 20, offset: 42990}, + pos: position{line: 1177, col: 20, offset: 40895}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1243, col: 11, offset: 43008}, + pos: position{line: 1178, col: 11, offset: 40913}, name: "DoubleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 1244, col: 11, offset: 43038}, + pos: position{line: 1179, col: 11, offset: 40943}, name: "QuotedString", }, &seqExpr{ - pos: position{line: 1245, col: 11, offset: 43061}, + pos: position{line: 1180, col: 11, offset: 40966}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1245, col: 11, offset: 43061}, + pos: position{line: 1180, col: 11, offset: 40966}, expr: &ruleRefExpr{ - pos: position{line: 1245, col: 11, offset: 43061}, + pos: position{line: 1180, col: 11, offset: 40966}, name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 1245, col: 18, offset: 43068}, + pos: position{line: 1180, col: 18, offset: 40973}, expr: &seqExpr{ - pos: position{line: 1245, col: 19, offset: 43069}, + pos: position{line: 1180, col: 19, offset: 40974}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1245, col: 19, offset: 43069}, + pos: position{line: 1180, col: 19, offset: 40974}, val: "*", ignoreCase: false, want: "\"*\"", }, ¬Expr{ - pos: position{line: 1245, col: 23, offset: 43073}, + pos: position{line: 1180, col: 23, offset: 40978}, expr: &litMatcher{ - pos: position{line: 1245, col: 24, offset: 43074}, + pos: position{line: 1180, col: 24, offset: 40979}, val: "*", ignoreCase: false, want: "\"*\"", @@ -8676,59 +8130,31 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1246, col: 11, offset: 43090}, + pos: position{line: 1181, col: 11, offset: 40995}, name: "ItalicText", }, &ruleRefExpr{ - pos: position{line: 1247, col: 11, offset: 43111}, + pos: position{line: 1182, col: 11, offset: 41016}, name: "MarkedText", }, &ruleRefExpr{ - pos: position{line: 1248, col: 11, offset: 43132}, + pos: position{line: 1183, col: 11, offset: 41037}, name: "MonospaceText", }, &ruleRefExpr{ - pos: position{line: 1249, col: 11, offset: 43156}, + pos: position{line: 1184, col: 11, offset: 41061}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1250, col: 11, offset: 43180}, + pos: position{line: 1185, col: 11, offset: 41085}, name: "SuperscriptText", }, &ruleRefExpr{ - pos: position{line: 1251, col: 11, offset: 43206}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1252, col: 11, offset: 43295}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1253, col: 11, offset: 43322}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1254, col: 11, offset: 43339}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1255, col: 11, offset: 43360}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1256, col: 11, offset: 43383}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1257, col: 11, offset: 43400}, - name: "AttributeSubstitution", + pos: position{line: 1194, col: 11, offset: 41373}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1258, col: 11, offset: 43432}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 1259, col: 11, offset: 43460}, + pos: position{line: 1195, col: 11, offset: 41402}, name: "SingleQuoteBoldTextFallbackCharacter", }, }, @@ -8736,31 +8162,31 @@ var g = &grammar{ }, { name: "SingleQuoteBoldTextFallbackCharacter", - pos: position{line: 1261, col: 1, offset: 43498}, + pos: position{line: 1197, col: 1, offset: 41440}, expr: &choiceExpr{ - pos: position{line: 1262, col: 5, offset: 43542}, + pos: position{line: 1198, col: 5, offset: 41484}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1262, col: 5, offset: 43542}, + pos: position{line: 1198, col: 5, offset: 41484}, val: "[^\\r\\n*]", chars: []rune{'\r', '\n', '*'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1263, col: 7, offset: 43639}, + pos: position{line: 1199, col: 7, offset: 41581}, run: (*parser).callonSingleQuoteBoldTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1263, col: 7, offset: 43639}, + pos: position{line: 1199, col: 7, offset: 41581}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1263, col: 7, offset: 43639}, + pos: position{line: 1199, col: 7, offset: 41581}, val: "*", ignoreCase: false, want: "\"*\"", }, &ruleRefExpr{ - pos: position{line: 1263, col: 11, offset: 43643}, + pos: position{line: 1199, col: 11, offset: 41585}, name: "Alphanums", }, }, @@ -8771,40 +8197,40 @@ var g = &grammar{ }, { name: "EscapedBoldText", - pos: position{line: 1267, col: 1, offset: 43806}, + pos: position{line: 1203, col: 1, offset: 41748}, expr: &choiceExpr{ - pos: position{line: 1268, col: 5, offset: 43830}, + pos: position{line: 1204, col: 5, offset: 41772}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1268, col: 5, offset: 43830}, + pos: position{line: 1204, col: 5, offset: 41772}, run: (*parser).callonEscapedBoldText2, expr: &seqExpr{ - pos: position{line: 1268, col: 5, offset: 43830}, + pos: position{line: 1204, col: 5, offset: 41772}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1268, col: 5, offset: 43830}, + pos: position{line: 1204, col: 5, offset: 41772}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1268, col: 18, offset: 43843}, + pos: position{line: 1204, col: 18, offset: 41785}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1268, col: 40, offset: 43865}, + pos: position{line: 1204, col: 40, offset: 41807}, val: "**", ignoreCase: false, want: "\"**\"", }, &labeledExpr{ - pos: position{line: 1268, col: 45, offset: 43870}, + pos: position{line: 1204, col: 45, offset: 41812}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1268, col: 55, offset: 43880}, + pos: position{line: 1204, col: 55, offset: 41822}, name: "DoubleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 1268, col: 84, offset: 43909}, + pos: position{line: 1204, col: 84, offset: 41851}, val: "**", ignoreCase: false, want: "\"**\"", @@ -8813,35 +8239,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1270, col: 9, offset: 44066}, + pos: position{line: 1206, col: 9, offset: 42008}, run: (*parser).callonEscapedBoldText10, expr: &seqExpr{ - pos: position{line: 1270, col: 9, offset: 44066}, + pos: position{line: 1206, col: 9, offset: 42008}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1270, col: 9, offset: 44066}, + pos: position{line: 1206, col: 9, offset: 42008}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1270, col: 22, offset: 44079}, + pos: position{line: 1206, col: 22, offset: 42021}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1270, col: 44, offset: 44101}, + pos: position{line: 1206, col: 44, offset: 42043}, val: "**", ignoreCase: false, want: "\"**\"", }, &labeledExpr{ - pos: position{line: 1270, col: 49, offset: 44106}, + pos: position{line: 1206, col: 49, offset: 42048}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1270, col: 59, offset: 44116}, + pos: position{line: 1206, col: 59, offset: 42058}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 1270, col: 88, offset: 44145}, + pos: position{line: 1206, col: 88, offset: 42087}, val: "*", ignoreCase: false, want: "\"*\"", @@ -8850,35 +8276,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1273, col: 9, offset: 44345}, + pos: position{line: 1209, col: 9, offset: 42287}, run: (*parser).callonEscapedBoldText18, expr: &seqExpr{ - pos: position{line: 1273, col: 9, offset: 44345}, + pos: position{line: 1209, col: 9, offset: 42287}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1273, col: 9, offset: 44345}, + pos: position{line: 1209, col: 9, offset: 42287}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1273, col: 22, offset: 44358}, + pos: position{line: 1209, col: 22, offset: 42300}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1273, col: 44, offset: 44380}, + pos: position{line: 1209, col: 44, offset: 42322}, val: "*", ignoreCase: false, want: "\"*\"", }, &labeledExpr{ - pos: position{line: 1273, col: 48, offset: 44384}, + pos: position{line: 1209, col: 48, offset: 42326}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1273, col: 58, offset: 44394}, + pos: position{line: 1209, col: 58, offset: 42336}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 1273, col: 87, offset: 44423}, + pos: position{line: 1209, col: 87, offset: 42365}, val: "*", ignoreCase: false, want: "\"*\"", @@ -8891,16 +8317,16 @@ var g = &grammar{ }, { name: "ItalicText", - pos: position{line: 1281, col: 1, offset: 44631}, + pos: position{line: 1217, col: 1, offset: 42573}, expr: &choiceExpr{ - pos: position{line: 1281, col: 15, offset: 44645}, + pos: position{line: 1217, col: 15, offset: 42587}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1281, col: 15, offset: 44645}, + pos: position{line: 1217, col: 15, offset: 42587}, name: "DoubleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 1281, col: 39, offset: 44669}, + pos: position{line: 1217, col: 39, offset: 42611}, name: "SingleQuoteItalicText", }, }, @@ -8908,40 +8334,40 @@ var g = &grammar{ }, { name: "DoubleQuoteItalicText", - pos: position{line: 1283, col: 1, offset: 44692}, + pos: position{line: 1219, col: 1, offset: 42634}, expr: &actionExpr{ - pos: position{line: 1283, col: 26, offset: 44717}, + pos: position{line: 1219, col: 26, offset: 42659}, run: (*parser).callonDoubleQuoteItalicText1, expr: &seqExpr{ - pos: position{line: 1283, col: 26, offset: 44717}, + pos: position{line: 1219, col: 26, offset: 42659}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1283, col: 26, offset: 44717}, + pos: position{line: 1219, col: 26, offset: 42659}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1283, col: 32, offset: 44723}, + pos: position{line: 1219, col: 32, offset: 42665}, expr: &ruleRefExpr{ - pos: position{line: 1283, col: 33, offset: 44724}, + pos: position{line: 1219, col: 33, offset: 42666}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1283, col: 51, offset: 44742}, + pos: position{line: 1219, col: 51, offset: 42684}, val: "__", ignoreCase: false, want: "\"__\"", }, &labeledExpr{ - pos: position{line: 1283, col: 56, offset: 44747}, + pos: position{line: 1219, col: 56, offset: 42689}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1283, col: 66, offset: 44757}, + pos: position{line: 1219, col: 66, offset: 42699}, name: "DoubleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1283, col: 97, offset: 44788}, + pos: position{line: 1219, col: 97, offset: 42730}, val: "__", ignoreCase: false, want: "\"__\"", @@ -8952,163 +8378,133 @@ var g = &grammar{ }, { name: "DoubleQuoteItalicTextElements", - pos: position{line: 1287, col: 1, offset: 44922}, - expr: &seqExpr{ - pos: position{line: 1287, col: 34, offset: 44955}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1287, col: 34, offset: 44955}, - name: "DoubleQuoteItalicTextElement", - }, - &zeroOrMoreExpr{ - pos: position{line: 1287, col: 63, offset: 44984}, - expr: &seqExpr{ - pos: position{line: 1287, col: 64, offset: 44985}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1287, col: 64, offset: 44985}, - expr: &litMatcher{ - pos: position{line: 1287, col: 66, offset: 44987}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, - }, - &choiceExpr{ - pos: position{line: 1287, col: 73, offset: 44994}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1287, col: 73, offset: 44994}, - name: "Space", - }, - &ruleRefExpr{ - pos: position{line: 1287, col: 81, offset: 45002}, - name: "DoubleQuoteItalicTextElement", - }, - }, - }, - }, - }, - }, + pos: position{line: 1223, col: 1, offset: 42864}, + expr: &zeroOrMoreExpr{ + pos: position{line: 1223, col: 34, offset: 42897}, + expr: &ruleRefExpr{ + pos: position{line: 1223, col: 34, offset: 42897}, + name: "DoubleQuoteItalicTextElement", }, }, }, { name: "DoubleQuoteItalicTextElement", - pos: position{line: 1289, col: 1, offset: 45069}, - expr: &choiceExpr{ - pos: position{line: 1289, col: 33, offset: 45101}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1289, col: 33, offset: 45101}, - name: "Word", - }, - &seqExpr{ - pos: position{line: 1290, col: 11, offset: 45116}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1290, col: 11, offset: 45116}, - name: "Newline", + pos: position{line: 1225, col: 1, offset: 42929}, + expr: &actionExpr{ + pos: position{line: 1225, col: 33, offset: 42961}, + run: (*parser).callonDoubleQuoteItalicTextElement1, + expr: &seqExpr{ + pos: position{line: 1225, col: 33, offset: 42961}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1225, col: 33, offset: 42961}, + expr: &litMatcher{ + pos: position{line: 1225, col: 35, offset: 42963}, + val: "__", + ignoreCase: false, + want: "\"__\"", }, - ¬Expr{ - pos: position{line: 1290, col: 19, offset: 45124}, - expr: &ruleRefExpr{ - pos: position{line: 1290, col: 20, offset: 45125}, - name: "Newline", + }, + &labeledExpr{ + pos: position{line: 1225, col: 41, offset: 42969}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1225, col: 50, offset: 42978}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1225, col: 50, offset: 42978}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 1226, col: 11, offset: 42993}, + name: "Space", + }, + &seqExpr{ + pos: position{line: 1227, col: 11, offset: 43042}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1227, col: 11, offset: 43042}, + name: "Newline", + }, + ¬Expr{ + pos: position{line: 1227, col: 19, offset: 43050}, + expr: &ruleRefExpr{ + pos: position{line: 1227, col: 20, offset: 43051}, + name: "Newline", + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1228, col: 11, offset: 43069}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1229, col: 11, offset: 43101}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1230, col: 11, offset: 43124}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1231, col: 11, offset: 43143}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1232, col: 11, offset: 43164}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1233, col: 11, offset: 43188}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1234, col: 11, offset: 43212}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1242, col: 11, offset: 43466}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1243, col: 11, offset: 43495}, + name: "DoubleQuoteItalicTextFallbackCharacter", + }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1291, col: 11, offset: 45143}, - name: "SingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1292, col: 11, offset: 45175}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1293, col: 11, offset: 45198}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1294, col: 11, offset: 45217}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1295, col: 11, offset: 45238}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1296, col: 11, offset: 45262}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1297, col: 11, offset: 45286}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1298, col: 11, offset: 45312}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1299, col: 11, offset: 45401}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1300, col: 11, offset: 45428}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1301, col: 11, offset: 45445}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1302, col: 11, offset: 45466}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1303, col: 11, offset: 45489}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1304, col: 11, offset: 45505}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 1305, col: 11, offset: 45533}, - name: "DoubleQuoteItalicTextFallbackCharacter", - }, }, }, }, { name: "DoubleQuoteItalicTextFallbackCharacter", - pos: position{line: 1307, col: 1, offset: 45573}, + pos: position{line: 1247, col: 1, offset: 43564}, expr: &choiceExpr{ - pos: position{line: 1308, col: 5, offset: 45619}, + pos: position{line: 1248, col: 5, offset: 43610}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1308, col: 5, offset: 45619}, + pos: position{line: 1248, col: 5, offset: 43610}, val: "[^\\r\\n_]", chars: []rune{'\r', '\n', '_'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1309, col: 7, offset: 45718}, + pos: position{line: 1249, col: 7, offset: 43709}, run: (*parser).callonDoubleQuoteItalicTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1309, col: 7, offset: 45718}, + pos: position{line: 1249, col: 7, offset: 43709}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1309, col: 7, offset: 45718}, + pos: position{line: 1249, col: 7, offset: 43709}, val: "__", ignoreCase: false, want: "\"__\"", }, &ruleRefExpr{ - pos: position{line: 1309, col: 12, offset: 45723}, + pos: position{line: 1249, col: 12, offset: 43714}, name: "Alphanums", }, }, @@ -9119,40 +8515,40 @@ var g = &grammar{ }, { name: "SingleQuoteItalicText", - pos: position{line: 1313, col: 1, offset: 45888}, + pos: position{line: 1253, col: 1, offset: 43879}, expr: &choiceExpr{ - pos: position{line: 1313, col: 26, offset: 45913}, + pos: position{line: 1253, col: 26, offset: 43904}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1313, col: 26, offset: 45913}, + pos: position{line: 1253, col: 26, offset: 43904}, run: (*parser).callonSingleQuoteItalicText2, expr: &seqExpr{ - pos: position{line: 1313, col: 26, offset: 45913}, + pos: position{line: 1253, col: 26, offset: 43904}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1313, col: 26, offset: 45913}, + pos: position{line: 1253, col: 26, offset: 43904}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1313, col: 32, offset: 45919}, + pos: position{line: 1253, col: 32, offset: 43910}, expr: &ruleRefExpr{ - pos: position{line: 1313, col: 33, offset: 45920}, + pos: position{line: 1253, col: 33, offset: 43911}, name: "QuotedTextAttrs", }, }, }, &seqExpr{ - pos: position{line: 1313, col: 52, offset: 45939}, + pos: position{line: 1253, col: 52, offset: 43930}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1313, col: 52, offset: 45939}, + pos: position{line: 1253, col: 52, offset: 43930}, val: "_", ignoreCase: false, want: "\"_\"", }, ¬Expr{ - pos: position{line: 1313, col: 56, offset: 45943}, + pos: position{line: 1253, col: 56, offset: 43934}, expr: &litMatcher{ - pos: position{line: 1313, col: 57, offset: 45944}, + pos: position{line: 1253, col: 57, offset: 43935}, val: "_", ignoreCase: false, want: "\"_\"", @@ -9161,15 +8557,15 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1313, col: 62, offset: 45949}, + pos: position{line: 1253, col: 62, offset: 43940}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1313, col: 72, offset: 45959}, + pos: position{line: 1253, col: 72, offset: 43950}, name: "SingleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1313, col: 103, offset: 45990}, + pos: position{line: 1253, col: 103, offset: 43981}, val: "_", ignoreCase: false, want: "\"_\"", @@ -9178,49 +8574,49 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1315, col: 5, offset: 46180}, + pos: position{line: 1255, col: 5, offset: 44171}, run: (*parser).callonSingleQuoteItalicText14, expr: &seqExpr{ - pos: position{line: 1315, col: 5, offset: 46180}, + pos: position{line: 1255, col: 5, offset: 44171}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1315, col: 5, offset: 46180}, + pos: position{line: 1255, col: 5, offset: 44171}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1315, col: 11, offset: 46186}, + pos: position{line: 1255, col: 11, offset: 44177}, expr: &ruleRefExpr{ - pos: position{line: 1315, col: 12, offset: 46187}, + pos: position{line: 1255, col: 12, offset: 44178}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1315, col: 30, offset: 46205}, + pos: position{line: 1255, col: 30, offset: 44196}, val: "_", ignoreCase: false, want: "\"_\"", }, &labeledExpr{ - pos: position{line: 1315, col: 34, offset: 46209}, + pos: position{line: 1255, col: 34, offset: 44200}, label: "elements", expr: &seqExpr{ - pos: position{line: 1315, col: 44, offset: 46219}, + pos: position{line: 1255, col: 44, offset: 44210}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1315, col: 44, offset: 46219}, + pos: position{line: 1255, col: 44, offset: 44210}, val: "_", ignoreCase: false, want: "\"_\"", }, &ruleRefExpr{ - pos: position{line: 1315, col: 48, offset: 46223}, + pos: position{line: 1255, col: 48, offset: 44214}, name: "SingleQuoteItalicTextElements", }, }, }, }, &litMatcher{ - pos: position{line: 1315, col: 79, offset: 46254}, + pos: position{line: 1255, col: 79, offset: 44245}, val: "_", ignoreCase: false, want: "\"_\"", @@ -9233,21 +8629,21 @@ var g = &grammar{ }, { name: "SingleQuoteItalicTextElements", - pos: position{line: 1319, col: 1, offset: 46464}, + pos: position{line: 1259, col: 1, offset: 44455}, expr: &seqExpr{ - pos: position{line: 1319, col: 34, offset: 46497}, + pos: position{line: 1259, col: 34, offset: 44488}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1319, col: 34, offset: 46497}, + pos: position{line: 1259, col: 34, offset: 44488}, expr: &ruleRefExpr{ - pos: position{line: 1319, col: 35, offset: 46498}, + pos: position{line: 1259, col: 35, offset: 44489}, name: "Space", }, }, &oneOrMoreExpr{ - pos: position{line: 1319, col: 41, offset: 46504}, + pos: position{line: 1259, col: 41, offset: 44495}, expr: &ruleRefExpr{ - pos: position{line: 1319, col: 41, offset: 46504}, + pos: position{line: 1259, col: 41, offset: 44495}, name: "SingleQuoteItalicTextElement", }, }, @@ -9256,63 +8652,63 @@ var g = &grammar{ }, { name: "SingleQuoteItalicTextElement", - pos: position{line: 1321, col: 1, offset: 46535}, + pos: position{line: 1261, col: 1, offset: 44526}, expr: &choiceExpr{ - pos: position{line: 1321, col: 33, offset: 46567}, + pos: position{line: 1261, col: 33, offset: 44558}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1321, col: 33, offset: 46567}, + pos: position{line: 1261, col: 33, offset: 44558}, name: "Word", }, &seqExpr{ - pos: position{line: 1322, col: 11, offset: 46582}, + pos: position{line: 1262, col: 11, offset: 44573}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1322, col: 11, offset: 46582}, + pos: position{line: 1262, col: 11, offset: 44573}, name: "Newline", }, ¬Expr{ - pos: position{line: 1322, col: 19, offset: 46590}, + pos: position{line: 1262, col: 19, offset: 44581}, expr: &ruleRefExpr{ - pos: position{line: 1322, col: 20, offset: 46591}, + pos: position{line: 1262, col: 20, offset: 44582}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1323, col: 11, offset: 46609}, + pos: position{line: 1263, col: 11, offset: 44600}, name: "DoubleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 1324, col: 11, offset: 46641}, + pos: position{line: 1264, col: 11, offset: 44632}, name: "QuotedString", }, &seqExpr{ - pos: position{line: 1325, col: 11, offset: 46664}, + pos: position{line: 1265, col: 11, offset: 44655}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1325, col: 11, offset: 46664}, + pos: position{line: 1265, col: 11, offset: 44655}, expr: &ruleRefExpr{ - pos: position{line: 1325, col: 11, offset: 46664}, + pos: position{line: 1265, col: 11, offset: 44655}, name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 1325, col: 18, offset: 46671}, + pos: position{line: 1265, col: 18, offset: 44662}, expr: &seqExpr{ - pos: position{line: 1325, col: 19, offset: 46672}, + pos: position{line: 1265, col: 19, offset: 44663}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1325, col: 19, offset: 46672}, + pos: position{line: 1265, col: 19, offset: 44663}, val: "_", ignoreCase: false, want: "\"_\"", }, ¬Expr{ - pos: position{line: 1325, col: 23, offset: 46676}, + pos: position{line: 1265, col: 23, offset: 44667}, expr: &litMatcher{ - pos: position{line: 1325, col: 24, offset: 46677}, + pos: position{line: 1265, col: 24, offset: 44668}, val: "_", ignoreCase: false, want: "\"_\"", @@ -9324,59 +8720,31 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1326, col: 11, offset: 46693}, + pos: position{line: 1266, col: 11, offset: 44684}, name: "BoldText", }, &ruleRefExpr{ - pos: position{line: 1327, col: 11, offset: 46712}, + pos: position{line: 1267, col: 11, offset: 44703}, name: "MarkedText", }, &ruleRefExpr{ - pos: position{line: 1328, col: 11, offset: 46733}, + pos: position{line: 1268, col: 11, offset: 44724}, name: "MonospaceText", }, &ruleRefExpr{ - pos: position{line: 1329, col: 11, offset: 46757}, + pos: position{line: 1269, col: 11, offset: 44748}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1330, col: 11, offset: 46781}, + pos: position{line: 1270, col: 11, offset: 44772}, name: "SuperscriptText", }, &ruleRefExpr{ - pos: position{line: 1331, col: 11, offset: 46807}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1332, col: 11, offset: 46896}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1333, col: 11, offset: 46923}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1334, col: 11, offset: 46940}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1335, col: 11, offset: 46961}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1336, col: 11, offset: 46984}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1337, col: 11, offset: 47001}, - name: "AttributeSubstitution", + pos: position{line: 1279, col: 11, offset: 45060}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1338, col: 11, offset: 47033}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 1339, col: 11, offset: 47061}, + pos: position{line: 1280, col: 11, offset: 45089}, name: "SingleQuoteItalicTextFallbackCharacter", }, }, @@ -9384,31 +8752,31 @@ var g = &grammar{ }, { name: "SingleQuoteItalicTextFallbackCharacter", - pos: position{line: 1341, col: 1, offset: 47101}, + pos: position{line: 1282, col: 1, offset: 45129}, expr: &choiceExpr{ - pos: position{line: 1342, col: 5, offset: 47147}, + pos: position{line: 1283, col: 5, offset: 45175}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1342, col: 5, offset: 47147}, + pos: position{line: 1283, col: 5, offset: 45175}, val: "[^\\r\\n_]", chars: []rune{'\r', '\n', '_'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1343, col: 7, offset: 47246}, + pos: position{line: 1284, col: 7, offset: 45274}, run: (*parser).callonSingleQuoteItalicTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1343, col: 7, offset: 47246}, + pos: position{line: 1284, col: 7, offset: 45274}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1343, col: 7, offset: 47246}, + pos: position{line: 1284, col: 7, offset: 45274}, val: "_", ignoreCase: false, want: "\"_\"", }, &ruleRefExpr{ - pos: position{line: 1343, col: 11, offset: 47250}, + pos: position{line: 1284, col: 11, offset: 45278}, name: "Alphanums", }, }, @@ -9419,405 +8787,683 @@ var g = &grammar{ }, { name: "EscapedItalicText", - pos: position{line: 1347, col: 1, offset: 47416}, + pos: position{line: 1288, col: 1, offset: 45444}, expr: &choiceExpr{ - pos: position{line: 1348, col: 5, offset: 47442}, + pos: position{line: 1289, col: 5, offset: 45470}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1348, col: 5, offset: 47442}, + pos: position{line: 1289, col: 5, offset: 45470}, run: (*parser).callonEscapedItalicText2, expr: &seqExpr{ - pos: position{line: 1348, col: 5, offset: 47442}, + pos: position{line: 1289, col: 5, offset: 45470}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1348, col: 5, offset: 47442}, + pos: position{line: 1289, col: 5, offset: 45470}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1348, col: 18, offset: 47455}, + pos: position{line: 1289, col: 18, offset: 45483}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1348, col: 40, offset: 47477}, + pos: position{line: 1289, col: 40, offset: 45505}, val: "__", ignoreCase: false, want: "\"__\"", }, &labeledExpr{ - pos: position{line: 1348, col: 45, offset: 47482}, + pos: position{line: 1289, col: 45, offset: 45510}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1348, col: 55, offset: 47492}, + pos: position{line: 1289, col: 55, offset: 45520}, name: "DoubleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1348, col: 86, offset: 47523}, - val: "__", + pos: position{line: 1289, col: 86, offset: 45551}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1291, col: 9, offset: 45708}, + run: (*parser).callonEscapedItalicText10, + expr: &seqExpr{ + pos: position{line: 1291, col: 9, offset: 45708}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1291, col: 9, offset: 45708}, + label: "backslashes", + expr: &ruleRefExpr{ + pos: position{line: 1291, col: 22, offset: 45721}, + name: "OneOrMoreBackslashes", + }, + }, + &litMatcher{ + pos: position{line: 1291, col: 44, offset: 45743}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1291, col: 49, offset: 45748}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1291, col: 59, offset: 45758}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1291, col: 90, offset: 45789}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1294, col: 9, offset: 45989}, + run: (*parser).callonEscapedItalicText18, + expr: &seqExpr{ + pos: position{line: 1294, col: 9, offset: 45989}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1294, col: 9, offset: 45989}, + label: "backslashes", + expr: &ruleRefExpr{ + pos: position{line: 1294, col: 22, offset: 46002}, + name: "OneOrMoreBackslashes", + }, + }, + &litMatcher{ + pos: position{line: 1294, col: 44, offset: 46024}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &labeledExpr{ + pos: position{line: 1294, col: 48, offset: 46028}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1294, col: 58, offset: 46038}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1294, col: 89, offset: 46069}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "MonospaceText", + pos: position{line: 1301, col: 1, offset: 46279}, + expr: &choiceExpr{ + pos: position{line: 1301, col: 18, offset: 46296}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1301, col: 18, offset: 46296}, + name: "DoubleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1301, col: 45, offset: 46323}, + name: "SingleQuoteMonospaceText", + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceText", + pos: position{line: 1303, col: 1, offset: 46349}, + expr: &actionExpr{ + pos: position{line: 1303, col: 29, offset: 46377}, + run: (*parser).callonDoubleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 1303, col: 29, offset: 46377}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1303, col: 29, offset: 46377}, + label: "attrs", + expr: &zeroOrOneExpr{ + pos: position{line: 1303, col: 35, offset: 46383}, + expr: &ruleRefExpr{ + pos: position{line: 1303, col: 36, offset: 46384}, + name: "QuotedTextAttrs", + }, + }, + }, + &litMatcher{ + pos: position{line: 1303, col: 54, offset: 46402}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 1303, col: 59, offset: 46407}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1303, col: 69, offset: 46417}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1303, col: 103, offset: 46451}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElements", + pos: position{line: 1307, col: 1, offset: 46588}, + expr: &zeroOrMoreExpr{ + pos: position{line: 1307, col: 37, offset: 46624}, + expr: &ruleRefExpr{ + pos: position{line: 1307, col: 37, offset: 46624}, + name: "DoubleQuoteMonospaceTextElement", + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElement", + pos: position{line: 1309, col: 1, offset: 46691}, + expr: &actionExpr{ + pos: position{line: 1309, col: 36, offset: 46726}, + run: (*parser).callonDoubleQuoteMonospaceTextElement1, + expr: &seqExpr{ + pos: position{line: 1309, col: 36, offset: 46726}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1309, col: 36, offset: 46726}, + expr: &litMatcher{ + pos: position{line: 1309, col: 38, offset: 46728}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + &labeledExpr{ + pos: position{line: 1309, col: 44, offset: 46734}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1309, col: 53, offset: 46743}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1309, col: 53, offset: 46743}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 1310, col: 11, offset: 46758}, + name: "Space", + }, + &seqExpr{ + pos: position{line: 1311, col: 11, offset: 46807}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1311, col: 11, offset: 46807}, + name: "Newline", + }, + ¬Expr{ + pos: position{line: 1311, col: 19, offset: 46815}, + expr: &ruleRefExpr{ + pos: position{line: 1311, col: 20, offset: 46816}, + name: "Newline", + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1312, col: 11, offset: 46834}, + name: "QuotedString", + }, + &actionExpr{ + pos: position{line: 1316, col: 11, offset: 46993}, + run: (*parser).callonDoubleQuoteMonospaceTextElement14, + expr: &ruleRefExpr{ + pos: position{line: 1316, col: 11, offset: 46993}, + name: "Apostrophe", + }, + }, + &ruleRefExpr{ + pos: position{line: 1320, col: 11, offset: 47177}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1321, col: 11, offset: 47212}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1322, col: 11, offset: 47231}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1323, col: 11, offset: 47252}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1324, col: 11, offset: 47273}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1325, col: 11, offset: 47297}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1330, col: 11, offset: 47413}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1331, col: 11, offset: 47442}, + name: "DoubleQuoteMonospaceTextFallbackCharacter", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextFallbackCharacter", + pos: position{line: 1335, col: 1, offset: 47514}, + expr: &choiceExpr{ + pos: position{line: 1336, col: 5, offset: 47563}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1336, col: 5, offset: 47563}, + val: "[^\\r\\n`]", + chars: []rune{'\r', '\n', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1337, col: 7, offset: 47665}, + run: (*parser).callonDoubleQuoteMonospaceTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 1337, col: 7, offset: 47665}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1337, col: 7, offset: 47665}, + val: "``", ignoreCase: false, - want: "\"__\"", + want: "\"``\"", + }, + &ruleRefExpr{ + pos: position{line: 1337, col: 12, offset: 47670}, + name: "Alphanums", }, }, }, }, + }, + }, + }, + { + name: "SingleQuoteMonospaceText", + pos: position{line: 1341, col: 1, offset: 47838}, + expr: &choiceExpr{ + pos: position{line: 1341, col: 29, offset: 47866}, + alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1350, col: 9, offset: 47680}, - run: (*parser).callonEscapedItalicText10, + pos: position{line: 1341, col: 29, offset: 47866}, + run: (*parser).callonSingleQuoteMonospaceText2, expr: &seqExpr{ - pos: position{line: 1350, col: 9, offset: 47680}, + pos: position{line: 1341, col: 29, offset: 47866}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1350, col: 9, offset: 47680}, - label: "backslashes", - expr: &ruleRefExpr{ - pos: position{line: 1350, col: 22, offset: 47693}, - name: "OneOrMoreBackslashes", + pos: position{line: 1341, col: 29, offset: 47866}, + label: "attrs", + expr: &zeroOrOneExpr{ + pos: position{line: 1341, col: 35, offset: 47872}, + expr: &ruleRefExpr{ + pos: position{line: 1341, col: 36, offset: 47873}, + name: "QuotedTextAttrs", + }, }, }, - &litMatcher{ - pos: position{line: 1350, col: 44, offset: 47715}, - val: "__", - ignoreCase: false, - want: "\"__\"", + &seqExpr{ + pos: position{line: 1341, col: 55, offset: 47892}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1341, col: 55, offset: 47892}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 1341, col: 59, offset: 47896}, + expr: &litMatcher{ + pos: position{line: 1341, col: 60, offset: 47897}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, }, &labeledExpr{ - pos: position{line: 1350, col: 49, offset: 47720}, + pos: position{line: 1341, col: 65, offset: 47902}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1350, col: 59, offset: 47730}, - name: "SingleQuoteItalicTextElements", + pos: position{line: 1341, col: 75, offset: 47912}, + name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1350, col: 90, offset: 47761}, - val: "_", + pos: position{line: 1341, col: 109, offset: 47946}, + val: "`", ignoreCase: false, - want: "\"_\"", + want: "\"`\"", }, }, }, }, &actionExpr{ - pos: position{line: 1353, col: 9, offset: 47961}, - run: (*parser).callonEscapedItalicText18, + pos: position{line: 1343, col: 5, offset: 48139}, + run: (*parser).callonSingleQuoteMonospaceText14, expr: &seqExpr{ - pos: position{line: 1353, col: 9, offset: 47961}, + pos: position{line: 1343, col: 5, offset: 48139}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1353, col: 9, offset: 47961}, - label: "backslashes", - expr: &ruleRefExpr{ - pos: position{line: 1353, col: 22, offset: 47974}, - name: "OneOrMoreBackslashes", + pos: position{line: 1343, col: 5, offset: 48139}, + label: "attrs", + expr: &zeroOrOneExpr{ + pos: position{line: 1343, col: 11, offset: 48145}, + expr: &ruleRefExpr{ + pos: position{line: 1343, col: 12, offset: 48146}, + name: "QuotedTextAttrs", + }, }, }, &litMatcher{ - pos: position{line: 1353, col: 44, offset: 47996}, - val: "_", + pos: position{line: 1343, col: 30, offset: 48164}, + val: "`", ignoreCase: false, - want: "\"_\"", + want: "\"`\"", }, &labeledExpr{ - pos: position{line: 1353, col: 48, offset: 48000}, + pos: position{line: 1343, col: 34, offset: 48168}, label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1353, col: 58, offset: 48010}, - name: "SingleQuoteItalicTextElements", + expr: &seqExpr{ + pos: position{line: 1343, col: 44, offset: 48178}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 44, offset: 48178}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &ruleRefExpr{ + pos: position{line: 1343, col: 48, offset: 48182}, + name: "SingleQuoteMonospaceTextElements", + }, + }, }, }, &litMatcher{ - pos: position{line: 1353, col: 89, offset: 48041}, - val: "_", + pos: position{line: 1343, col: 82, offset: 48216}, + val: "`", ignoreCase: false, - want: "\"_\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "MonospaceText", - pos: position{line: 1360, col: 1, offset: 48251}, - expr: &choiceExpr{ - pos: position{line: 1360, col: 18, offset: 48268}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1360, col: 18, offset: 48268}, - name: "DoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1360, col: 45, offset: 48295}, - name: "SingleQuoteMonospaceText", - }, - }, - }, - }, - { - name: "DoubleQuoteMonospaceText", - pos: position{line: 1362, col: 1, offset: 48321}, - expr: &actionExpr{ - pos: position{line: 1362, col: 29, offset: 48349}, - run: (*parser).callonDoubleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1362, col: 29, offset: 48349}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1362, col: 29, offset: 48349}, - label: "attrs", - expr: &zeroOrOneExpr{ - pos: position{line: 1362, col: 35, offset: 48355}, - expr: &ruleRefExpr{ - pos: position{line: 1362, col: 36, offset: 48356}, - name: "QuotedTextAttrs", + want: "\"`\"", }, }, }, - &litMatcher{ - pos: position{line: 1362, col: 54, offset: 48374}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1362, col: 59, offset: 48379}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1362, col: 69, offset: 48389}, - name: "DoubleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1362, col: 103, offset: 48423}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, }, }, }, }, { - name: "DoubleQuoteMonospaceTextElements", - pos: position{line: 1366, col: 1, offset: 48560}, + name: "SingleQuoteMonospaceTextElements", + pos: position{line: 1347, col: 1, offset: 48430}, expr: &seqExpr{ - pos: position{line: 1366, col: 37, offset: 48596}, + pos: position{line: 1347, col: 37, offset: 48466}, exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1366, col: 37, offset: 48596}, - name: "DoubleQuoteMonospaceTextElement", + ¬Expr{ + pos: position{line: 1347, col: 37, offset: 48466}, + expr: &ruleRefExpr{ + pos: position{line: 1347, col: 38, offset: 48467}, + name: "Space", + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1366, col: 69, offset: 48628}, - expr: &seqExpr{ - pos: position{line: 1366, col: 70, offset: 48629}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1366, col: 70, offset: 48629}, - expr: &litMatcher{ - pos: position{line: 1366, col: 72, offset: 48631}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - }, - &choiceExpr{ - pos: position{line: 1366, col: 79, offset: 48638}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1366, col: 79, offset: 48638}, - name: "Space", - }, - &ruleRefExpr{ - pos: position{line: 1366, col: 87, offset: 48646}, - name: "DoubleQuoteMonospaceTextElement", - }, - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 1347, col: 44, offset: 48473}, + expr: &ruleRefExpr{ + pos: position{line: 1347, col: 44, offset: 48473}, + name: "SingleQuoteMonospaceTextElement", }, }, }, }, }, { - name: "DoubleQuoteMonospaceTextElement", - pos: position{line: 1368, col: 1, offset: 48715}, + name: "SingleQuoteMonospaceTextElement", + pos: position{line: 1349, col: 1, offset: 48507}, expr: &choiceExpr{ - pos: position{line: 1368, col: 36, offset: 48750}, + pos: position{line: 1349, col: 37, offset: 48543}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1368, col: 36, offset: 48750}, + pos: position{line: 1349, col: 37, offset: 48543}, name: "Word", }, &seqExpr{ - pos: position{line: 1369, col: 11, offset: 48765}, + pos: position{line: 1350, col: 11, offset: 48558}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1369, col: 11, offset: 48765}, + pos: position{line: 1350, col: 11, offset: 48558}, name: "Newline", }, ¬Expr{ - pos: position{line: 1369, col: 19, offset: 48773}, + pos: position{line: 1350, col: 19, offset: 48566}, expr: &ruleRefExpr{ - pos: position{line: 1369, col: 20, offset: 48774}, + pos: position{line: 1350, col: 20, offset: 48567}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1370, col: 11, offset: 48792}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1371, col: 11, offset: 48815}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1372, col: 11, offset: 48904}, - name: "Symbol", + pos: position{line: 1351, col: 11, offset: 48585}, + name: "DoubleQuoteMonospaceText", }, &ruleRefExpr{ - pos: position{line: 1373, col: 11, offset: 48921}, - name: "SpecialCharacter", + pos: position{line: 1352, col: 11, offset: 48620}, + name: "QuotedString", }, - &ruleRefExpr{ - pos: position{line: 1374, col: 11, offset: 48948}, - name: "SingleQuoteMonospaceText", + &seqExpr{ + pos: position{line: 1353, col: 11, offset: 48643}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1353, col: 11, offset: 48643}, + expr: &ruleRefExpr{ + pos: position{line: 1353, col: 11, offset: 48643}, + name: "Space", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 1353, col: 18, offset: 48650}, + expr: &seqExpr{ + pos: position{line: 1353, col: 19, offset: 48651}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1353, col: 19, offset: 48651}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 1353, col: 23, offset: 48655}, + expr: &litMatcher{ + pos: position{line: 1353, col: 24, offset: 48656}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + }, }, &ruleRefExpr{ - pos: position{line: 1375, col: 11, offset: 48983}, + pos: position{line: 1354, col: 11, offset: 48784}, name: "BoldText", }, &ruleRefExpr{ - pos: position{line: 1376, col: 11, offset: 49002}, + pos: position{line: 1355, col: 11, offset: 48803}, name: "ItalicText", }, &ruleRefExpr{ - pos: position{line: 1377, col: 11, offset: 49023}, + pos: position{line: 1356, col: 11, offset: 48824}, name: "MarkedText", }, &ruleRefExpr{ - pos: position{line: 1378, col: 11, offset: 49044}, + pos: position{line: 1357, col: 11, offset: 48845}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1379, col: 11, offset: 49068}, + pos: position{line: 1358, col: 11, offset: 48869}, name: "SuperscriptText", }, - &ruleRefExpr{ - pos: position{line: 1380, col: 11, offset: 49094}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1381, col: 11, offset: 49115}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1382, col: 11, offset: 49137}, - name: "Link", + &actionExpr{ + pos: position{line: 1359, col: 11, offset: 48895}, + run: (*parser).callonSingleQuoteMonospaceTextElement22, + expr: &ruleRefExpr{ + pos: position{line: 1359, col: 11, offset: 48895}, + name: "Apostrophe", + }, }, &ruleRefExpr{ - pos: position{line: 1383, col: 11, offset: 49152}, - name: "ImpliedApostrophe", + pos: position{line: 1371, col: 11, offset: 49302}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1384, col: 11, offset: 49180}, - name: "DoubleQuoteMonospaceTextFallbackCharacter", + pos: position{line: 1372, col: 11, offset: 49331}, + name: "SingleQuoteMonospaceTextFallbackCharacter", }, }, }, }, { - name: "DoubleQuoteMonospaceTextFallbackCharacter", - pos: position{line: 1386, col: 1, offset: 49223}, + name: "SingleQuoteMonospaceTextFallbackCharacter", + pos: position{line: 1374, col: 1, offset: 49374}, expr: &choiceExpr{ - pos: position{line: 1387, col: 5, offset: 49272}, + pos: position{line: 1375, col: 5, offset: 49423}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1387, col: 5, offset: 49272}, + pos: position{line: 1375, col: 5, offset: 49423}, val: "[^\\r\\n`]", chars: []rune{'\r', '\n', '`'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1388, col: 7, offset: 49374}, - run: (*parser).callonDoubleQuoteMonospaceTextFallbackCharacter3, + pos: position{line: 1376, col: 7, offset: 49525}, + run: (*parser).callonSingleQuoteMonospaceTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1388, col: 7, offset: 49374}, + pos: position{line: 1376, col: 7, offset: 49525}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1388, col: 7, offset: 49374}, - val: "``", + pos: position{line: 1376, col: 7, offset: 49525}, + val: "`", ignoreCase: false, - want: "\"``\"", + want: "\"`\"", }, &ruleRefExpr{ - pos: position{line: 1388, col: 12, offset: 49379}, + pos: position{line: 1376, col: 11, offset: 49529}, name: "Alphanums", }, }, }, }, - }, - }, - }, - { - name: "SingleQuoteMonospaceText", - pos: position{line: 1392, col: 1, offset: 49547}, - expr: &choiceExpr{ - pos: position{line: 1392, col: 29, offset: 49575}, - alternatives: []interface{}{ + }, + }, + }, + { + name: "EscapedMonospaceText", + pos: position{line: 1380, col: 1, offset: 49698}, + expr: &choiceExpr{ + pos: position{line: 1381, col: 5, offset: 49727}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1381, col: 5, offset: 49727}, + run: (*parser).callonEscapedMonospaceText2, + expr: &seqExpr{ + pos: position{line: 1381, col: 5, offset: 49727}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1381, col: 5, offset: 49727}, + label: "backslashes", + expr: &ruleRefExpr{ + pos: position{line: 1381, col: 18, offset: 49740}, + name: "TwoOrMoreBackslashes", + }, + }, + &litMatcher{ + pos: position{line: 1381, col: 40, offset: 49762}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 1381, col: 45, offset: 49767}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1381, col: 55, offset: 49777}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1381, col: 89, offset: 49811}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, &actionExpr{ - pos: position{line: 1392, col: 29, offset: 49575}, - run: (*parser).callonSingleQuoteMonospaceText2, + pos: position{line: 1383, col: 9, offset: 49968}, + run: (*parser).callonEscapedMonospaceText10, expr: &seqExpr{ - pos: position{line: 1392, col: 29, offset: 49575}, + pos: position{line: 1383, col: 9, offset: 49968}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1392, col: 29, offset: 49575}, - label: "attrs", - expr: &zeroOrOneExpr{ - pos: position{line: 1392, col: 35, offset: 49581}, - expr: &ruleRefExpr{ - pos: position{line: 1392, col: 36, offset: 49582}, - name: "QuotedTextAttrs", - }, + pos: position{line: 1383, col: 9, offset: 49968}, + label: "backslashes", + expr: &ruleRefExpr{ + pos: position{line: 1383, col: 22, offset: 49981}, + name: "OneOrMoreBackslashes", }, }, - &seqExpr{ - pos: position{line: 1392, col: 55, offset: 49601}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1392, col: 55, offset: 49601}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 1392, col: 59, offset: 49605}, - expr: &litMatcher{ - pos: position{line: 1392, col: 60, offset: 49606}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 1383, col: 44, offset: 50003}, + val: "``", + ignoreCase: false, + want: "\"``\"", }, &labeledExpr{ - pos: position{line: 1392, col: 65, offset: 49611}, + pos: position{line: 1383, col: 49, offset: 50008}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1392, col: 75, offset: 49621}, + pos: position{line: 1383, col: 59, offset: 50018}, name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1392, col: 109, offset: 49655}, + pos: position{line: 1383, col: 93, offset: 50052}, val: "`", ignoreCase: false, want: "\"`\"", @@ -9826,49 +9472,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1394, col: 5, offset: 49848}, - run: (*parser).callonSingleQuoteMonospaceText14, + pos: position{line: 1386, col: 9, offset: 50252}, + run: (*parser).callonEscapedMonospaceText18, expr: &seqExpr{ - pos: position{line: 1394, col: 5, offset: 49848}, + pos: position{line: 1386, col: 9, offset: 50252}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1394, col: 5, offset: 49848}, - label: "attrs", - expr: &zeroOrOneExpr{ - pos: position{line: 1394, col: 11, offset: 49854}, - expr: &ruleRefExpr{ - pos: position{line: 1394, col: 12, offset: 49855}, - name: "QuotedTextAttrs", - }, + pos: position{line: 1386, col: 9, offset: 50252}, + label: "backslashes", + expr: &ruleRefExpr{ + pos: position{line: 1386, col: 22, offset: 50265}, + name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1394, col: 30, offset: 49873}, + pos: position{line: 1386, col: 44, offset: 50287}, val: "`", ignoreCase: false, want: "\"`\"", }, &labeledExpr{ - pos: position{line: 1394, col: 34, offset: 49877}, + pos: position{line: 1386, col: 48, offset: 50291}, label: "elements", - expr: &seqExpr{ - pos: position{line: 1394, col: 44, offset: 49887}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1394, col: 44, offset: 49887}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - &ruleRefExpr{ - pos: position{line: 1394, col: 48, offset: 49891}, - name: "SingleQuoteMonospaceTextElements", - }, - }, + expr: &ruleRefExpr{ + pos: position{line: 1386, col: 58, offset: 50301}, + name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1394, col: 82, offset: 49925}, + pos: position{line: 1386, col: 92, offset: 50335}, val: "`", ignoreCase: false, want: "\"`\"", @@ -9880,198 +9512,254 @@ var g = &grammar{ }, }, { - name: "SingleQuoteMonospaceTextElements", - pos: position{line: 1398, col: 1, offset: 50139}, - expr: &seqExpr{ - pos: position{line: 1398, col: 37, offset: 50175}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1398, col: 37, offset: 50175}, - expr: &ruleRefExpr{ - pos: position{line: 1398, col: 38, offset: 50176}, - name: "Space", + name: "QuotedString", + pos: position{line: 1394, col: 1, offset: 50660}, + expr: &choiceExpr{ + pos: position{line: 1394, col: 17, offset: 50676}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1394, col: 17, offset: 50676}, + name: "SingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1394, col: 38, offset: 50697}, + name: "DoubleQuotedString", + }, + }, + }, + }, + { + name: "SingleQuotedString", + pos: position{line: 1396, col: 1, offset: 50717}, + expr: &actionExpr{ + pos: position{line: 1396, col: 23, offset: 50739}, + run: (*parser).callonSingleQuotedString1, + expr: &seqExpr{ + pos: position{line: 1396, col: 23, offset: 50739}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1396, col: 23, offset: 50739}, + name: "SingleQuoteStringStart", + }, + &labeledExpr{ + pos: position{line: 1396, col: 46, offset: 50762}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1396, col: 55, offset: 50771}, + name: "SingleQuotedStringElements", + }, + }, + &ruleRefExpr{ + pos: position{line: 1396, col: 82, offset: 50798}, + name: "SingleQuoteStringEnd", }, }, - &oneOrMoreExpr{ - pos: position{line: 1398, col: 44, offset: 50182}, + }, + }, + }, + { + name: "SingleQuotedStringElements", + pos: position{line: 1400, col: 1, offset: 50902}, + expr: &actionExpr{ + pos: position{line: 1400, col: 31, offset: 50932}, + run: (*parser).callonSingleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 1400, col: 31, offset: 50932}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1400, col: 41, offset: 50942}, expr: &ruleRefExpr{ - pos: position{line: 1398, col: 44, offset: 50182}, - name: "SingleQuoteMonospaceTextElement", + pos: position{line: 1400, col: 41, offset: 50942}, + name: "SingleQuotedStringElement", }, }, }, }, }, { - name: "SingleQuoteMonospaceTextElement", - pos: position{line: 1400, col: 1, offset: 50216}, - expr: &choiceExpr{ - pos: position{line: 1400, col: 37, offset: 50252}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1400, col: 37, offset: 50252}, - name: "Word", + name: "SingleQuoteStringStart", + pos: position{line: 1404, col: 1, offset: 51020}, + expr: &seqExpr{ + pos: position{line: 1404, col: 27, offset: 51046}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1404, col: 27, offset: 51046}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", }, - &seqExpr{ - pos: position{line: 1401, col: 11, offset: 50267}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1401, col: 11, offset: 50267}, - name: "Newline", - }, - ¬Expr{ - pos: position{line: 1401, col: 19, offset: 50275}, - expr: &ruleRefExpr{ - pos: position{line: 1401, col: 20, offset: 50276}, - name: "Newline", - }, - }, + ¬Expr{ + pos: position{line: 1404, col: 32, offset: 51051}, + expr: &charClassMatcher{ + pos: position{line: 1404, col: 33, offset: 51052}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, }, }, - &ruleRefExpr{ - pos: position{line: 1402, col: 11, offset: 50294}, - name: "DoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1403, col: 11, offset: 50329}, - name: "QuotedString", - }, - &seqExpr{ - pos: position{line: 1404, col: 11, offset: 50352}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1404, col: 11, offset: 50352}, - expr: &ruleRefExpr{ - pos: position{line: 1404, col: 11, offset: 50352}, - name: "Space", + }, + }, + }, + { + name: "SingleQuoteStringEnd", + pos: position{line: 1406, col: 1, offset: 51063}, + expr: &litMatcher{ + pos: position{line: 1406, col: 25, offset: 51087}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + { + name: "SingleQuotedStringElement", + pos: position{line: 1409, col: 1, offset: 51175}, + expr: &actionExpr{ + pos: position{line: 1409, col: 30, offset: 51204}, + run: (*parser).callonSingleQuotedStringElement1, + expr: &labeledExpr{ + pos: position{line: 1409, col: 30, offset: 51204}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1410, col: 9, offset: 51222}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 1410, col: 9, offset: 51222}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1410, col: 9, offset: 51222}, + name: "LineBreak", + }, + ¬Expr{ + pos: position{line: 1410, col: 19, offset: 51232}, + expr: &ruleRefExpr{ + pos: position{line: 1410, col: 20, offset: 51233}, + name: "SingleQuoteStringEnd", + }, + }, }, }, - &zeroOrOneExpr{ - pos: position{line: 1404, col: 18, offset: 50359}, - expr: &seqExpr{ - pos: position{line: 1404, col: 19, offset: 50360}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1404, col: 19, offset: 50360}, + &seqExpr{ + pos: position{line: 1411, col: 11, offset: 51289}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1411, col: 11, offset: 51289}, + expr: &ruleRefExpr{ + pos: position{line: 1411, col: 11, offset: 51289}, + name: "Space", + }, + }, + ¬Expr{ + pos: position{line: 1411, col: 18, offset: 51296}, + expr: &ruleRefExpr{ + pos: position{line: 1411, col: 19, offset: 51297}, + name: "SingleQuoteStringEnd", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 1412, col: 11, offset: 51328}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1412, col: 11, offset: 51328}, + expr: &litMatcher{ + pos: position{line: 1412, col: 12, offset: 51329}, val: "`", ignoreCase: false, want: "\"`\"", }, - ¬Expr{ - pos: position{line: 1404, col: 23, offset: 50364}, - expr: &litMatcher{ - pos: position{line: 1404, col: 24, offset: 50365}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, + }, + &ruleRefExpr{ + pos: position{line: 1412, col: 16, offset: 51333}, + name: "Symbol", }, }, }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1405, col: 11, offset: 50493}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1406, col: 11, offset: 50512}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1407, col: 11, offset: 50533}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1408, col: 11, offset: 50554}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1409, col: 11, offset: 50578}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1410, col: 11, offset: 50604}, - name: "InlinePassthrough", - }, - &seqExpr{ - pos: position{line: 1411, col: 11, offset: 50693}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1411, col: 11, offset: 50693}, - expr: &litMatcher{ - pos: position{line: 1411, col: 12, offset: 50694}, - val: "`", - ignoreCase: false, - want: "\"`\"", + &ruleRefExpr{ + pos: position{line: 1419, col: 11, offset: 51591}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1420, col: 11, offset: 51610}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1421, col: 11, offset: 51631}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1422, col: 11, offset: 51652}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1423, col: 11, offset: 51676}, + name: "SuperscriptText", + }, + &seqExpr{ + pos: position{line: 1424, col: 11, offset: 51702}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1424, col: 11, offset: 51702}, + expr: &litMatcher{ + pos: position{line: 1424, col: 12, offset: 51703}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &ruleRefExpr{ + pos: position{line: 1424, col: 17, offset: 51708}, + name: "MonospaceText", + }, }, }, &ruleRefExpr{ - pos: position{line: 1411, col: 16, offset: 50698}, - name: "Symbol", + pos: position{line: 1425, col: 11, offset: 51732}, + name: "DoubleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1428, col: 11, offset: 51818}, + name: "SingleQuotedStringFallbackCharacter", }, }, }, - &ruleRefExpr{ - pos: position{line: 1412, col: 11, offset: 50715}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1413, col: 11, offset: 50742}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1414, col: 11, offset: 50763}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1415, col: 11, offset: 50786}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1416, col: 11, offset: 50802}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 1417, col: 11, offset: 50834}, - name: "ImpliedApostrophe", - }, - &ruleRefExpr{ - pos: position{line: 1418, col: 11, offset: 50862}, - name: "SingleQuoteMonospaceTextFallbackCharacter", - }, }, }, }, { - name: "SingleQuoteMonospaceTextFallbackCharacter", - pos: position{line: 1420, col: 1, offset: 50905}, + name: "SingleQuotedStringFallbackCharacter", + pos: position{line: 1432, col: 1, offset: 51884}, expr: &choiceExpr{ - pos: position{line: 1421, col: 5, offset: 50954}, + pos: position{line: 1432, col: 41, offset: 51924}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1421, col: 5, offset: 50954}, - val: "[^\\r\\n`]", - chars: []rune{'\r', '\n', '`'}, + pos: position{line: 1432, col: 41, offset: 51924}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1422, col: 7, offset: 51056}, - run: (*parser).callonSingleQuoteMonospaceTextFallbackCharacter3, + pos: position{line: 1432, col: 55, offset: 51938}, + run: (*parser).callonSingleQuotedStringFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1422, col: 7, offset: 51056}, + pos: position{line: 1432, col: 55, offset: 51938}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1422, col: 7, offset: 51056}, + pos: position{line: 1432, col: 55, offset: 51938}, val: "`", ignoreCase: false, want: "\"`\"", }, - &ruleRefExpr{ - pos: position{line: 1422, col: 11, offset: 51060}, - name: "Alphanums", + ¬Expr{ + pos: position{line: 1432, col: 59, offset: 51942}, + expr: &litMatcher{ + pos: position{line: 1432, col: 60, offset: 51943}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, }, }, }, @@ -10080,118 +9768,219 @@ var g = &grammar{ }, }, { - name: "EscapedMonospaceText", - pos: position{line: 1426, col: 1, offset: 51229}, - expr: &choiceExpr{ - pos: position{line: 1427, col: 5, offset: 51258}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1427, col: 5, offset: 51258}, - run: (*parser).callonEscapedMonospaceText2, - expr: &seqExpr{ - pos: position{line: 1427, col: 5, offset: 51258}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1427, col: 5, offset: 51258}, - label: "backslashes", - expr: &ruleRefExpr{ - pos: position{line: 1427, col: 18, offset: 51271}, - name: "TwoOrMoreBackslashes", - }, - }, - &litMatcher{ - pos: position{line: 1427, col: 40, offset: 51293}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1427, col: 45, offset: 51298}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1427, col: 55, offset: 51308}, - name: "DoubleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1427, col: 89, offset: 51342}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, + name: "DoubleQuotedString", + pos: position{line: 1436, col: 1, offset: 52002}, + expr: &actionExpr{ + pos: position{line: 1436, col: 23, offset: 52024}, + run: (*parser).callonDoubleQuotedString1, + expr: &seqExpr{ + pos: position{line: 1436, col: 23, offset: 52024}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1436, col: 23, offset: 52024}, + name: "DoubleQuoteStringStart", + }, + &labeledExpr{ + pos: position{line: 1436, col: 46, offset: 52047}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1436, col: 55, offset: 52056}, + name: "DoubleQuotedStringElements", }, }, + &ruleRefExpr{ + pos: position{line: 1436, col: 82, offset: 52083}, + name: "DoubleQuoteStringEnd", + }, }, - &actionExpr{ - pos: position{line: 1429, col: 9, offset: 51499}, - run: (*parser).callonEscapedMonospaceText10, - expr: &seqExpr{ - pos: position{line: 1429, col: 9, offset: 51499}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1429, col: 9, offset: 51499}, - label: "backslashes", - expr: &ruleRefExpr{ - pos: position{line: 1429, col: 22, offset: 51512}, - name: "OneOrMoreBackslashes", + }, + }, + }, + { + name: "DoubleQuotedStringElements", + pos: position{line: 1440, col: 1, offset: 52187}, + expr: &actionExpr{ + pos: position{line: 1440, col: 31, offset: 52217}, + run: (*parser).callonDoubleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 1440, col: 31, offset: 52217}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1440, col: 41, offset: 52227}, + expr: &ruleRefExpr{ + pos: position{line: 1440, col: 41, offset: 52227}, + name: "DoubleQuotedStringElement", + }, + }, + }, + }, + }, + { + name: "DoubleQuotedStringElement", + pos: position{line: 1445, col: 1, offset: 52387}, + expr: &actionExpr{ + pos: position{line: 1445, col: 30, offset: 52416}, + run: (*parser).callonDoubleQuotedStringElement1, + expr: &labeledExpr{ + pos: position{line: 1445, col: 30, offset: 52416}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1446, col: 9, offset: 52434}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 1446, col: 9, offset: 52434}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1446, col: 9, offset: 52434}, + name: "LineBreak", + }, + ¬Expr{ + pos: position{line: 1446, col: 19, offset: 52444}, + expr: &ruleRefExpr{ + pos: position{line: 1446, col: 20, offset: 52445}, + name: "DoubleQuoteStringEnd", + }, }, }, - &litMatcher{ - pos: position{line: 1429, col: 44, offset: 51534}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1429, col: 49, offset: 51539}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1429, col: 59, offset: 51549}, - name: "SingleQuoteMonospaceTextElements", + }, + &seqExpr{ + pos: position{line: 1447, col: 11, offset: 52501}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1447, col: 11, offset: 52501}, + expr: &ruleRefExpr{ + pos: position{line: 1447, col: 11, offset: 52501}, + name: "Space", + }, + }, + ¬Expr{ + pos: position{line: 1447, col: 18, offset: 52508}, + expr: &ruleRefExpr{ + pos: position{line: 1447, col: 19, offset: 52509}, + name: "DoubleQuoteStringEnd", + }, }, }, - &litMatcher{ - pos: position{line: 1429, col: 93, offset: 51583}, - val: "`", - ignoreCase: false, - want: "\"`\"", + }, + &ruleRefExpr{ + pos: position{line: 1456, col: 11, offset: 52796}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1457, col: 11, offset: 52815}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1458, col: 11, offset: 52836}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1459, col: 11, offset: 52857}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1460, col: 11, offset: 52881}, + name: "SuperscriptText", + }, + &seqExpr{ + pos: position{line: 1461, col: 11, offset: 52907}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1461, col: 11, offset: 52907}, + expr: &litMatcher{ + pos: position{line: 1461, col: 12, offset: 52908}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + &ruleRefExpr{ + pos: position{line: 1461, col: 18, offset: 52914}, + name: "MonospaceText", + }, }, }, + &ruleRefExpr{ + pos: position{line: 1462, col: 10, offset: 52937}, + name: "SingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1464, col: 11, offset: 52995}, + name: "DoubleQuotedStringFallbackCharacter", + }, }, }, - &actionExpr{ - pos: position{line: 1432, col: 9, offset: 51783}, - run: (*parser).callonEscapedMonospaceText18, - expr: &seqExpr{ - pos: position{line: 1432, col: 9, offset: 51783}, + }, + }, + }, + { + name: "DoubleQuoteStringStart", + pos: position{line: 1468, col: 1, offset: 53069}, + expr: &seqExpr{ + pos: position{line: 1468, col: 27, offset: 53095}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1468, col: 27, offset: 53095}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + ¬Expr{ + pos: position{line: 1468, col: 33, offset: 53101}, + expr: &charClassMatcher{ + pos: position{line: 1468, col: 34, offset: 53102}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + { + name: "DoubleQuoteStringEnd", + pos: position{line: 1470, col: 1, offset: 53113}, + expr: &litMatcher{ + pos: position{line: 1470, col: 25, offset: 53137}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + { + name: "DoubleQuotedStringFallbackCharacter", + pos: position{line: 1472, col: 1, offset: 53144}, + expr: &actionExpr{ + pos: position{line: 1472, col: 41, offset: 53184}, + run: (*parser).callonDoubleQuotedStringFallbackCharacter1, + expr: &choiceExpr{ + pos: position{line: 1472, col: 42, offset: 53185}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1472, col: 42, offset: 53185}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, + ignoreCase: false, + inverted: true, + }, + &seqExpr{ + pos: position{line: 1472, col: 56, offset: 53199}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1432, col: 9, offset: 51783}, - label: "backslashes", - expr: &ruleRefExpr{ - pos: position{line: 1432, col: 22, offset: 51796}, - name: "OneOrMoreBackslashes", - }, - }, &litMatcher{ - pos: position{line: 1432, col: 44, offset: 51818}, + pos: position{line: 1472, col: 56, offset: 53199}, val: "`", ignoreCase: false, want: "\"`\"", }, - &labeledExpr{ - pos: position{line: 1432, col: 48, offset: 51822}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1432, col: 58, offset: 51832}, - name: "SingleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1432, col: 92, offset: 51866}, - val: "`", - ignoreCase: false, - want: "\"`\"", + ¬Expr{ + pos: position{line: 1472, col: 60, offset: 53203}, + expr: &litMatcher{ + pos: position{line: 1472, col: 61, offset: 53204}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, }, }, }, @@ -10201,16 +9990,16 @@ var g = &grammar{ }, { name: "MarkedText", - pos: position{line: 1440, col: 1, offset: 52074}, + pos: position{line: 1481, col: 1, offset: 53324}, expr: &choiceExpr{ - pos: position{line: 1440, col: 15, offset: 52088}, + pos: position{line: 1481, col: 15, offset: 53338}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1440, col: 15, offset: 52088}, + pos: position{line: 1481, col: 15, offset: 53338}, name: "DoubleQuoteMarkedText", }, &ruleRefExpr{ - pos: position{line: 1440, col: 39, offset: 52112}, + pos: position{line: 1481, col: 39, offset: 53362}, name: "SingleQuoteMarkedText", }, }, @@ -10218,40 +10007,40 @@ var g = &grammar{ }, { name: "DoubleQuoteMarkedText", - pos: position{line: 1442, col: 1, offset: 52135}, + pos: position{line: 1483, col: 1, offset: 53385}, expr: &actionExpr{ - pos: position{line: 1442, col: 26, offset: 52160}, + pos: position{line: 1483, col: 26, offset: 53410}, run: (*parser).callonDoubleQuoteMarkedText1, expr: &seqExpr{ - pos: position{line: 1442, col: 26, offset: 52160}, + pos: position{line: 1483, col: 26, offset: 53410}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1442, col: 26, offset: 52160}, + pos: position{line: 1483, col: 26, offset: 53410}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1442, col: 32, offset: 52166}, + pos: position{line: 1483, col: 32, offset: 53416}, expr: &ruleRefExpr{ - pos: position{line: 1442, col: 33, offset: 52167}, + pos: position{line: 1483, col: 33, offset: 53417}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1442, col: 51, offset: 52185}, + pos: position{line: 1483, col: 51, offset: 53435}, val: "##", ignoreCase: false, want: "\"##\"", }, &labeledExpr{ - pos: position{line: 1442, col: 56, offset: 52190}, + pos: position{line: 1483, col: 56, offset: 53440}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1442, col: 66, offset: 52200}, + pos: position{line: 1483, col: 66, offset: 53450}, name: "DoubleQuoteMarkedTextElements", }, }, &litMatcher{ - pos: position{line: 1442, col: 97, offset: 52231}, + pos: position{line: 1483, col: 97, offset: 53481}, val: "##", ignoreCase: false, want: "\"##\"", @@ -10262,37 +10051,37 @@ var g = &grammar{ }, { name: "DoubleQuoteMarkedTextElements", - pos: position{line: 1446, col: 1, offset: 52365}, + pos: position{line: 1487, col: 1, offset: 53615}, expr: &seqExpr{ - pos: position{line: 1446, col: 34, offset: 52398}, + pos: position{line: 1487, col: 34, offset: 53648}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1446, col: 34, offset: 52398}, + pos: position{line: 1487, col: 34, offset: 53648}, name: "DoubleQuoteMarkedTextElement", }, &zeroOrMoreExpr{ - pos: position{line: 1446, col: 63, offset: 52427}, + pos: position{line: 1487, col: 63, offset: 53677}, expr: &seqExpr{ - pos: position{line: 1446, col: 64, offset: 52428}, + pos: position{line: 1487, col: 64, offset: 53678}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1446, col: 64, offset: 52428}, + pos: position{line: 1487, col: 64, offset: 53678}, expr: &litMatcher{ - pos: position{line: 1446, col: 66, offset: 52430}, + pos: position{line: 1487, col: 66, offset: 53680}, val: "##", ignoreCase: false, want: "\"##\"", }, }, &choiceExpr{ - pos: position{line: 1446, col: 73, offset: 52437}, + pos: position{line: 1487, col: 73, offset: 53687}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1446, col: 73, offset: 52437}, + pos: position{line: 1487, col: 73, offset: 53687}, name: "Space", }, &ruleRefExpr{ - pos: position{line: 1446, col: 81, offset: 52445}, + pos: position{line: 1487, col: 81, offset: 53695}, name: "DoubleQuoteMarkedTextElement", }, }, @@ -10305,88 +10094,64 @@ var g = &grammar{ }, { name: "DoubleQuoteMarkedTextElement", - pos: position{line: 1448, col: 1, offset: 52512}, + pos: position{line: 1489, col: 1, offset: 53762}, expr: &choiceExpr{ - pos: position{line: 1448, col: 33, offset: 52544}, + pos: position{line: 1489, col: 33, offset: 53794}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1448, col: 33, offset: 52544}, + pos: position{line: 1489, col: 33, offset: 53794}, name: "Word", }, &ruleRefExpr{ - pos: position{line: 1449, col: 11, offset: 52559}, + pos: position{line: 1490, col: 11, offset: 53809}, name: "SingleQuoteMarkedText", }, &seqExpr{ - pos: position{line: 1450, col: 11, offset: 52591}, + pos: position{line: 1491, col: 11, offset: 53841}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1450, col: 11, offset: 52591}, + pos: position{line: 1491, col: 11, offset: 53841}, name: "Newline", }, ¬Expr{ - pos: position{line: 1450, col: 19, offset: 52599}, + pos: position{line: 1491, col: 19, offset: 53849}, expr: &ruleRefExpr{ - pos: position{line: 1450, col: 20, offset: 52600}, + pos: position{line: 1491, col: 20, offset: 53850}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1451, col: 11, offset: 52618}, + pos: position{line: 1492, col: 11, offset: 53868}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 1452, col: 11, offset: 52641}, + pos: position{line: 1493, col: 11, offset: 53891}, name: "BoldText", }, &ruleRefExpr{ - pos: position{line: 1453, col: 11, offset: 52660}, + pos: position{line: 1494, col: 11, offset: 53910}, name: "ItalicText", }, &ruleRefExpr{ - pos: position{line: 1454, col: 11, offset: 52681}, + pos: position{line: 1495, col: 11, offset: 53931}, name: "MonospaceText", }, &ruleRefExpr{ - pos: position{line: 1455, col: 11, offset: 52705}, + pos: position{line: 1496, col: 11, offset: 53955}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1456, col: 11, offset: 52729}, + pos: position{line: 1497, col: 11, offset: 53979}, name: "SuperscriptText", }, &ruleRefExpr{ - pos: position{line: 1457, col: 11, offset: 52755}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1458, col: 11, offset: 52844}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1459, col: 11, offset: 52861}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1460, col: 11, offset: 52888}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1461, col: 11, offset: 52909}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1462, col: 11, offset: 52931}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1463, col: 11, offset: 52946}, - name: "ImpliedApostrophe", + pos: position{line: 1505, col: 11, offset: 54231}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1464, col: 11, offset: 52974}, + pos: position{line: 1506, col: 11, offset: 54260}, name: "DoubleQuoteMarkedTextFallbackCharacter", }, }, @@ -10394,31 +10159,31 @@ var g = &grammar{ }, { name: "DoubleQuoteMarkedTextFallbackCharacter", - pos: position{line: 1466, col: 1, offset: 53014}, + pos: position{line: 1508, col: 1, offset: 54300}, expr: &choiceExpr{ - pos: position{line: 1467, col: 5, offset: 53060}, + pos: position{line: 1509, col: 5, offset: 54346}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1467, col: 5, offset: 53060}, + pos: position{line: 1509, col: 5, offset: 54346}, val: "[^\\r\\n#]", chars: []rune{'\r', '\n', '#'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1468, col: 7, offset: 53159}, + pos: position{line: 1510, col: 7, offset: 54445}, run: (*parser).callonDoubleQuoteMarkedTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1468, col: 7, offset: 53159}, + pos: position{line: 1510, col: 7, offset: 54445}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1468, col: 7, offset: 53159}, + pos: position{line: 1510, col: 7, offset: 54445}, val: "##", ignoreCase: false, want: "\"##\"", }, &ruleRefExpr{ - pos: position{line: 1468, col: 12, offset: 53164}, + pos: position{line: 1510, col: 12, offset: 54450}, name: "Alphanums", }, }, @@ -10429,40 +10194,40 @@ var g = &grammar{ }, { name: "SingleQuoteMarkedText", - pos: position{line: 1472, col: 1, offset: 53329}, + pos: position{line: 1514, col: 1, offset: 54615}, expr: &choiceExpr{ - pos: position{line: 1472, col: 26, offset: 53354}, + pos: position{line: 1514, col: 26, offset: 54640}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1472, col: 26, offset: 53354}, + pos: position{line: 1514, col: 26, offset: 54640}, run: (*parser).callonSingleQuoteMarkedText2, expr: &seqExpr{ - pos: position{line: 1472, col: 26, offset: 53354}, + pos: position{line: 1514, col: 26, offset: 54640}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1472, col: 26, offset: 53354}, + pos: position{line: 1514, col: 26, offset: 54640}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1472, col: 32, offset: 53360}, + pos: position{line: 1514, col: 32, offset: 54646}, expr: &ruleRefExpr{ - pos: position{line: 1472, col: 33, offset: 53361}, + pos: position{line: 1514, col: 33, offset: 54647}, name: "QuotedTextAttrs", }, }, }, &seqExpr{ - pos: position{line: 1472, col: 52, offset: 53380}, + pos: position{line: 1514, col: 52, offset: 54666}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1472, col: 52, offset: 53380}, + pos: position{line: 1514, col: 52, offset: 54666}, val: "#", ignoreCase: false, want: "\"#\"", }, ¬Expr{ - pos: position{line: 1472, col: 56, offset: 53384}, + pos: position{line: 1514, col: 56, offset: 54670}, expr: &litMatcher{ - pos: position{line: 1472, col: 57, offset: 53385}, + pos: position{line: 1514, col: 57, offset: 54671}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10471,15 +10236,15 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1472, col: 62, offset: 53390}, + pos: position{line: 1514, col: 62, offset: 54676}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1472, col: 72, offset: 53400}, + pos: position{line: 1514, col: 72, offset: 54686}, name: "SingleQuoteMarkedTextElements", }, }, &litMatcher{ - pos: position{line: 1472, col: 103, offset: 53431}, + pos: position{line: 1514, col: 103, offset: 54717}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10488,49 +10253,49 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1474, col: 5, offset: 53621}, + pos: position{line: 1516, col: 5, offset: 54907}, run: (*parser).callonSingleQuoteMarkedText14, expr: &seqExpr{ - pos: position{line: 1474, col: 5, offset: 53621}, + pos: position{line: 1516, col: 5, offset: 54907}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1474, col: 5, offset: 53621}, + pos: position{line: 1516, col: 5, offset: 54907}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1474, col: 11, offset: 53627}, + pos: position{line: 1516, col: 11, offset: 54913}, expr: &ruleRefExpr{ - pos: position{line: 1474, col: 12, offset: 53628}, + pos: position{line: 1516, col: 12, offset: 54914}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1474, col: 30, offset: 53646}, + pos: position{line: 1516, col: 30, offset: 54932}, val: "#", ignoreCase: false, want: "\"#\"", }, &labeledExpr{ - pos: position{line: 1474, col: 34, offset: 53650}, + pos: position{line: 1516, col: 34, offset: 54936}, label: "elements", expr: &seqExpr{ - pos: position{line: 1474, col: 44, offset: 53660}, + pos: position{line: 1516, col: 44, offset: 54946}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1474, col: 44, offset: 53660}, + pos: position{line: 1516, col: 44, offset: 54946}, val: "#", ignoreCase: false, want: "\"#\"", }, &ruleRefExpr{ - pos: position{line: 1474, col: 48, offset: 53664}, + pos: position{line: 1516, col: 48, offset: 54950}, name: "SingleQuoteMarkedTextElements", }, }, }, }, &litMatcher{ - pos: position{line: 1474, col: 79, offset: 53695}, + pos: position{line: 1516, col: 79, offset: 54981}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10543,21 +10308,21 @@ var g = &grammar{ }, { name: "SingleQuoteMarkedTextElements", - pos: position{line: 1478, col: 1, offset: 53904}, + pos: position{line: 1520, col: 1, offset: 55190}, expr: &seqExpr{ - pos: position{line: 1478, col: 34, offset: 53937}, + pos: position{line: 1520, col: 34, offset: 55223}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1478, col: 34, offset: 53937}, + pos: position{line: 1520, col: 34, offset: 55223}, expr: &ruleRefExpr{ - pos: position{line: 1478, col: 35, offset: 53938}, + pos: position{line: 1520, col: 35, offset: 55224}, name: "Space", }, }, &oneOrMoreExpr{ - pos: position{line: 1478, col: 41, offset: 53944}, + pos: position{line: 1520, col: 41, offset: 55230}, expr: &ruleRefExpr{ - pos: position{line: 1478, col: 41, offset: 53944}, + pos: position{line: 1520, col: 41, offset: 55230}, name: "SingleQuoteMarkedTextElement", }, }, @@ -10566,63 +10331,63 @@ var g = &grammar{ }, { name: "SingleQuoteMarkedTextElement", - pos: position{line: 1480, col: 1, offset: 53975}, + pos: position{line: 1522, col: 1, offset: 55261}, expr: &choiceExpr{ - pos: position{line: 1480, col: 33, offset: 54007}, + pos: position{line: 1522, col: 33, offset: 55293}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1480, col: 33, offset: 54007}, + pos: position{line: 1522, col: 33, offset: 55293}, name: "Word", }, &ruleRefExpr{ - pos: position{line: 1481, col: 11, offset: 54022}, + pos: position{line: 1523, col: 11, offset: 55308}, name: "DoubleQuoteMarkedText", }, &seqExpr{ - pos: position{line: 1482, col: 11, offset: 54054}, + pos: position{line: 1524, col: 11, offset: 55340}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1482, col: 11, offset: 54054}, + pos: position{line: 1524, col: 11, offset: 55340}, name: "Newline", }, ¬Expr{ - pos: position{line: 1482, col: 19, offset: 54062}, + pos: position{line: 1524, col: 19, offset: 55348}, expr: &ruleRefExpr{ - pos: position{line: 1482, col: 20, offset: 54063}, + pos: position{line: 1524, col: 20, offset: 55349}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1483, col: 11, offset: 54081}, + pos: position{line: 1525, col: 11, offset: 55367}, name: "QuotedString", }, &seqExpr{ - pos: position{line: 1484, col: 11, offset: 54104}, + pos: position{line: 1526, col: 11, offset: 55390}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1484, col: 11, offset: 54104}, + pos: position{line: 1526, col: 11, offset: 55390}, expr: &ruleRefExpr{ - pos: position{line: 1484, col: 11, offset: 54104}, + pos: position{line: 1526, col: 11, offset: 55390}, name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 1484, col: 18, offset: 54111}, + pos: position{line: 1526, col: 18, offset: 55397}, expr: &seqExpr{ - pos: position{line: 1484, col: 19, offset: 54112}, + pos: position{line: 1526, col: 19, offset: 55398}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1484, col: 19, offset: 54112}, + pos: position{line: 1526, col: 19, offset: 55398}, val: "#", ignoreCase: false, want: "\"#\"", }, ¬Expr{ - pos: position{line: 1484, col: 23, offset: 54116}, + pos: position{line: 1526, col: 23, offset: 55402}, expr: &litMatcher{ - pos: position{line: 1484, col: 24, offset: 54117}, + pos: position{line: 1526, col: 24, offset: 55403}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10634,59 +10399,31 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1485, col: 11, offset: 54133}, + pos: position{line: 1527, col: 11, offset: 55419}, name: "BoldText", }, &ruleRefExpr{ - pos: position{line: 1486, col: 11, offset: 54152}, + pos: position{line: 1528, col: 11, offset: 55438}, name: "ItalicText", }, &ruleRefExpr{ - pos: position{line: 1487, col: 11, offset: 54173}, + pos: position{line: 1529, col: 11, offset: 55459}, name: "MonospaceText", }, &ruleRefExpr{ - pos: position{line: 1488, col: 11, offset: 54197}, + pos: position{line: 1530, col: 11, offset: 55483}, name: "SubscriptText", }, &ruleRefExpr{ - pos: position{line: 1489, col: 11, offset: 54221}, + pos: position{line: 1531, col: 11, offset: 55507}, name: "SuperscriptText", }, &ruleRefExpr{ - pos: position{line: 1490, col: 11, offset: 54247}, - name: "Symbol", - }, - &ruleRefExpr{ - pos: position{line: 1491, col: 11, offset: 54264}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1492, col: 11, offset: 54353}, - name: "SpecialCharacter", - }, - &ruleRefExpr{ - pos: position{line: 1493, col: 11, offset: 54380}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1494, col: 11, offset: 54401}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1495, col: 11, offset: 54423}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1496, col: 11, offset: 54438}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 1497, col: 11, offset: 54470}, - name: "ImpliedApostrophe", + pos: position{line: 1540, col: 11, offset: 55792}, + name: "ElementPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1498, col: 11, offset: 54498}, + pos: position{line: 1541, col: 11, offset: 55821}, name: "SingleQuoteMarkedTextFallbackCharacter", }, }, @@ -10694,31 +10431,31 @@ var g = &grammar{ }, { name: "SingleQuoteMarkedTextFallbackCharacter", - pos: position{line: 1500, col: 1, offset: 54538}, + pos: position{line: 1543, col: 1, offset: 55861}, expr: &choiceExpr{ - pos: position{line: 1501, col: 5, offset: 54584}, + pos: position{line: 1544, col: 5, offset: 55907}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 1501, col: 5, offset: 54584}, + pos: position{line: 1544, col: 5, offset: 55907}, val: "[^\\r\\n#]", chars: []rune{'\r', '\n', '#'}, ignoreCase: false, inverted: true, }, &actionExpr{ - pos: position{line: 1502, col: 7, offset: 54681}, + pos: position{line: 1545, col: 7, offset: 56004}, run: (*parser).callonSingleQuoteMarkedTextFallbackCharacter3, expr: &seqExpr{ - pos: position{line: 1502, col: 7, offset: 54681}, + pos: position{line: 1545, col: 7, offset: 56004}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1502, col: 7, offset: 54681}, + pos: position{line: 1545, col: 7, offset: 56004}, val: "#", ignoreCase: false, want: "\"#\"", }, &ruleRefExpr{ - pos: position{line: 1502, col: 11, offset: 54685}, + pos: position{line: 1545, col: 11, offset: 56008}, name: "Alphanums", }, }, @@ -10729,40 +10466,40 @@ var g = &grammar{ }, { name: "EscapedMarkedText", - pos: position{line: 1506, col: 1, offset: 54848}, + pos: position{line: 1549, col: 1, offset: 56171}, expr: &choiceExpr{ - pos: position{line: 1507, col: 5, offset: 54873}, + pos: position{line: 1550, col: 5, offset: 56196}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1507, col: 5, offset: 54873}, + pos: position{line: 1550, col: 5, offset: 56196}, run: (*parser).callonEscapedMarkedText2, expr: &seqExpr{ - pos: position{line: 1507, col: 5, offset: 54873}, + pos: position{line: 1550, col: 5, offset: 56196}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1507, col: 5, offset: 54873}, + pos: position{line: 1550, col: 5, offset: 56196}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1507, col: 18, offset: 54886}, + pos: position{line: 1550, col: 18, offset: 56209}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1507, col: 40, offset: 54908}, + pos: position{line: 1550, col: 40, offset: 56231}, val: "##", ignoreCase: false, want: "\"##\"", }, &labeledExpr{ - pos: position{line: 1507, col: 45, offset: 54913}, + pos: position{line: 1550, col: 45, offset: 56236}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1507, col: 55, offset: 54923}, + pos: position{line: 1550, col: 55, offset: 56246}, name: "DoubleQuoteMarkedTextElements", }, }, &litMatcher{ - pos: position{line: 1507, col: 86, offset: 54954}, + pos: position{line: 1550, col: 86, offset: 56277}, val: "##", ignoreCase: false, want: "\"##\"", @@ -10771,35 +10508,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1509, col: 9, offset: 55111}, + pos: position{line: 1552, col: 9, offset: 56434}, run: (*parser).callonEscapedMarkedText10, expr: &seqExpr{ - pos: position{line: 1509, col: 9, offset: 55111}, + pos: position{line: 1552, col: 9, offset: 56434}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1509, col: 9, offset: 55111}, + pos: position{line: 1552, col: 9, offset: 56434}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1509, col: 22, offset: 55124}, + pos: position{line: 1552, col: 22, offset: 56447}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1509, col: 44, offset: 55146}, + pos: position{line: 1552, col: 44, offset: 56469}, val: "##", ignoreCase: false, want: "\"##\"", }, &labeledExpr{ - pos: position{line: 1509, col: 49, offset: 55151}, + pos: position{line: 1552, col: 49, offset: 56474}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1509, col: 59, offset: 55161}, + pos: position{line: 1552, col: 59, offset: 56484}, name: "SingleQuoteMarkedTextElements", }, }, &litMatcher{ - pos: position{line: 1509, col: 90, offset: 55192}, + pos: position{line: 1552, col: 90, offset: 56515}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10808,35 +10545,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1512, col: 9, offset: 55392}, + pos: position{line: 1555, col: 9, offset: 56715}, run: (*parser).callonEscapedMarkedText18, expr: &seqExpr{ - pos: position{line: 1512, col: 9, offset: 55392}, + pos: position{line: 1555, col: 9, offset: 56715}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1512, col: 9, offset: 55392}, + pos: position{line: 1555, col: 9, offset: 56715}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1512, col: 22, offset: 55405}, + pos: position{line: 1555, col: 22, offset: 56728}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1512, col: 44, offset: 55427}, + pos: position{line: 1555, col: 44, offset: 56750}, val: "#", ignoreCase: false, want: "\"#\"", }, &labeledExpr{ - pos: position{line: 1512, col: 48, offset: 55431}, + pos: position{line: 1555, col: 48, offset: 56754}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1512, col: 58, offset: 55441}, + pos: position{line: 1555, col: 58, offset: 56764}, name: "SingleQuoteMarkedTextElements", }, }, &litMatcher{ - pos: position{line: 1512, col: 89, offset: 55472}, + pos: position{line: 1555, col: 89, offset: 56795}, val: "#", ignoreCase: false, want: "\"#\"", @@ -10849,40 +10586,40 @@ var g = &grammar{ }, { name: "SubscriptText", - pos: position{line: 1517, col: 1, offset: 55622}, + pos: position{line: 1560, col: 1, offset: 56945}, expr: &actionExpr{ - pos: position{line: 1517, col: 18, offset: 55639}, + pos: position{line: 1560, col: 18, offset: 56962}, run: (*parser).callonSubscriptText1, expr: &seqExpr{ - pos: position{line: 1517, col: 18, offset: 55639}, + pos: position{line: 1560, col: 18, offset: 56962}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1517, col: 18, offset: 55639}, + pos: position{line: 1560, col: 18, offset: 56962}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1517, col: 24, offset: 55645}, + pos: position{line: 1560, col: 24, offset: 56968}, expr: &ruleRefExpr{ - pos: position{line: 1517, col: 25, offset: 55646}, + pos: position{line: 1560, col: 25, offset: 56969}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1517, col: 43, offset: 55664}, + pos: position{line: 1560, col: 43, offset: 56987}, val: "~", ignoreCase: false, want: "\"~\"", }, &labeledExpr{ - pos: position{line: 1517, col: 47, offset: 55668}, + pos: position{line: 1560, col: 47, offset: 56991}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1517, col: 56, offset: 55677}, + pos: position{line: 1560, col: 56, offset: 57000}, name: "SubscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1517, col: 78, offset: 55699}, + pos: position{line: 1560, col: 78, offset: 57022}, val: "~", ignoreCase: false, want: "\"~\"", @@ -10893,16 +10630,16 @@ var g = &grammar{ }, { name: "SubscriptTextElement", - pos: position{line: 1521, col: 1, offset: 55795}, + pos: position{line: 1564, col: 1, offset: 57118}, expr: &choiceExpr{ - pos: position{line: 1521, col: 25, offset: 55819}, + pos: position{line: 1564, col: 25, offset: 57142}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1521, col: 25, offset: 55819}, + pos: position{line: 1564, col: 25, offset: 57142}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1521, col: 38, offset: 55832}, + pos: position{line: 1564, col: 38, offset: 57155}, name: "NonSubscriptText", }, }, @@ -10910,14 +10647,14 @@ var g = &grammar{ }, { name: "NonSubscriptText", - pos: position{line: 1523, col: 1, offset: 55851}, + pos: position{line: 1566, col: 1, offset: 57174}, expr: &actionExpr{ - pos: position{line: 1523, col: 21, offset: 55871}, + pos: position{line: 1566, col: 21, offset: 57194}, run: (*parser).callonNonSubscriptText1, expr: &oneOrMoreExpr{ - pos: position{line: 1523, col: 21, offset: 55871}, + pos: position{line: 1566, col: 21, offset: 57194}, expr: &charClassMatcher{ - pos: position{line: 1523, col: 21, offset: 55871}, + pos: position{line: 1566, col: 21, offset: 57194}, val: "[^\\r\\n ~]", chars: []rune{'\r', '\n', ' ', '~'}, ignoreCase: false, @@ -10928,37 +10665,37 @@ var g = &grammar{ }, { name: "EscapedSubscriptText", - pos: position{line: 1527, col: 1, offset: 55948}, + pos: position{line: 1570, col: 1, offset: 57271}, expr: &actionExpr{ - pos: position{line: 1527, col: 25, offset: 55972}, + pos: position{line: 1570, col: 25, offset: 57295}, run: (*parser).callonEscapedSubscriptText1, expr: &seqExpr{ - pos: position{line: 1527, col: 25, offset: 55972}, + pos: position{line: 1570, col: 25, offset: 57295}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1527, col: 25, offset: 55972}, + pos: position{line: 1570, col: 25, offset: 57295}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1527, col: 38, offset: 55985}, + pos: position{line: 1570, col: 38, offset: 57308}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1527, col: 60, offset: 56007}, + pos: position{line: 1570, col: 60, offset: 57330}, val: "~", ignoreCase: false, want: "\"~\"", }, &labeledExpr{ - pos: position{line: 1527, col: 64, offset: 56011}, + pos: position{line: 1570, col: 64, offset: 57334}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1527, col: 73, offset: 56020}, + pos: position{line: 1570, col: 73, offset: 57343}, name: "SubscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1527, col: 95, offset: 56042}, + pos: position{line: 1570, col: 95, offset: 57365}, val: "~", ignoreCase: false, want: "\"~\"", @@ -10969,40 +10706,40 @@ var g = &grammar{ }, { name: "SuperscriptText", - pos: position{line: 1531, col: 1, offset: 56171}, + pos: position{line: 1574, col: 1, offset: 57494}, expr: &actionExpr{ - pos: position{line: 1531, col: 20, offset: 56190}, + pos: position{line: 1574, col: 20, offset: 57513}, run: (*parser).callonSuperscriptText1, expr: &seqExpr{ - pos: position{line: 1531, col: 20, offset: 56190}, + pos: position{line: 1574, col: 20, offset: 57513}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1531, col: 20, offset: 56190}, + pos: position{line: 1574, col: 20, offset: 57513}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 1531, col: 26, offset: 56196}, + pos: position{line: 1574, col: 26, offset: 57519}, expr: &ruleRefExpr{ - pos: position{line: 1531, col: 27, offset: 56197}, + pos: position{line: 1574, col: 27, offset: 57520}, name: "QuotedTextAttrs", }, }, }, &litMatcher{ - pos: position{line: 1531, col: 45, offset: 56215}, + pos: position{line: 1574, col: 45, offset: 57538}, val: "^", ignoreCase: false, want: "\"^\"", }, &labeledExpr{ - pos: position{line: 1531, col: 49, offset: 56219}, + pos: position{line: 1574, col: 49, offset: 57542}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1531, col: 58, offset: 56228}, + pos: position{line: 1574, col: 58, offset: 57551}, name: "SuperscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1531, col: 82, offset: 56252}, + pos: position{line: 1574, col: 82, offset: 57575}, val: "^", ignoreCase: false, want: "\"^\"", @@ -11013,16 +10750,16 @@ var g = &grammar{ }, { name: "SuperscriptTextElement", - pos: position{line: 1535, col: 1, offset: 56350}, + pos: position{line: 1578, col: 1, offset: 57673}, expr: &choiceExpr{ - pos: position{line: 1535, col: 27, offset: 56376}, + pos: position{line: 1578, col: 27, offset: 57699}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1535, col: 27, offset: 56376}, + pos: position{line: 1578, col: 27, offset: 57699}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1535, col: 40, offset: 56389}, + pos: position{line: 1578, col: 40, offset: 57712}, name: "NonSuperscriptText", }, }, @@ -11030,14 +10767,14 @@ var g = &grammar{ }, { name: "NonSuperscriptText", - pos: position{line: 1537, col: 1, offset: 56410}, + pos: position{line: 1580, col: 1, offset: 57733}, expr: &actionExpr{ - pos: position{line: 1537, col: 23, offset: 56432}, + pos: position{line: 1580, col: 23, offset: 57755}, run: (*parser).callonNonSuperscriptText1, expr: &oneOrMoreExpr{ - pos: position{line: 1537, col: 23, offset: 56432}, + pos: position{line: 1580, col: 23, offset: 57755}, expr: &charClassMatcher{ - pos: position{line: 1537, col: 23, offset: 56432}, + pos: position{line: 1580, col: 23, offset: 57755}, val: "[^\\r\\n ^]", chars: []rune{'\r', '\n', ' ', '^'}, ignoreCase: false, @@ -11048,37 +10785,37 @@ var g = &grammar{ }, { name: "EscapedSuperscriptText", - pos: position{line: 1541, col: 1, offset: 56509}, + pos: position{line: 1584, col: 1, offset: 57832}, expr: &actionExpr{ - pos: position{line: 1541, col: 27, offset: 56535}, + pos: position{line: 1584, col: 27, offset: 57858}, run: (*parser).callonEscapedSuperscriptText1, expr: &seqExpr{ - pos: position{line: 1541, col: 27, offset: 56535}, + pos: position{line: 1584, col: 27, offset: 57858}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1541, col: 27, offset: 56535}, + pos: position{line: 1584, col: 27, offset: 57858}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1541, col: 40, offset: 56548}, + pos: position{line: 1584, col: 40, offset: 57871}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1541, col: 62, offset: 56570}, + pos: position{line: 1584, col: 62, offset: 57893}, val: "^", ignoreCase: false, want: "\"^\"", }, &labeledExpr{ - pos: position{line: 1541, col: 66, offset: 56574}, + pos: position{line: 1584, col: 66, offset: 57897}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1541, col: 75, offset: 56583}, + pos: position{line: 1584, col: 75, offset: 57906}, name: "SuperscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1541, col: 99, offset: 56607}, + pos: position{line: 1584, col: 99, offset: 57930}, val: "^", ignoreCase: false, want: "\"^\"", @@ -11089,20 +10826,20 @@ var g = &grammar{ }, { name: "InlinePassthrough", - pos: position{line: 1548, col: 1, offset: 56849}, + pos: position{line: 1591, col: 1, offset: 58172}, expr: &choiceExpr{ - pos: position{line: 1548, col: 22, offset: 56870}, + pos: position{line: 1591, col: 22, offset: 58193}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1548, col: 22, offset: 56870}, + pos: position{line: 1591, col: 22, offset: 58193}, name: "TriplePlusPassthrough", }, &ruleRefExpr{ - pos: position{line: 1548, col: 46, offset: 56894}, + pos: position{line: 1591, col: 46, offset: 58217}, name: "SinglePlusPassthrough", }, &ruleRefExpr{ - pos: position{line: 1548, col: 70, offset: 56918}, + pos: position{line: 1591, col: 70, offset: 58241}, name: "PassthroughMacro", }, }, @@ -11110,9 +10847,9 @@ var g = &grammar{ }, { name: "SinglePlusPassthroughPrefix", - pos: position{line: 1550, col: 1, offset: 56936}, + pos: position{line: 1593, col: 1, offset: 58259}, expr: &litMatcher{ - pos: position{line: 1550, col: 32, offset: 56967}, + pos: position{line: 1593, col: 32, offset: 58290}, val: "+", ignoreCase: false, want: "\"+\"", @@ -11120,33 +10857,33 @@ var g = &grammar{ }, { name: "SinglePlusPassthrough", - pos: position{line: 1552, col: 1, offset: 56972}, + pos: position{line: 1595, col: 1, offset: 58295}, expr: &actionExpr{ - pos: position{line: 1552, col: 26, offset: 56997}, + pos: position{line: 1595, col: 26, offset: 58320}, run: (*parser).callonSinglePlusPassthrough1, expr: &seqExpr{ - pos: position{line: 1552, col: 26, offset: 56997}, + pos: position{line: 1595, col: 26, offset: 58320}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1552, col: 26, offset: 56997}, + pos: position{line: 1595, col: 26, offset: 58320}, name: "SinglePlusPassthroughPrefix", }, &labeledExpr{ - pos: position{line: 1552, col: 54, offset: 57025}, + pos: position{line: 1595, col: 54, offset: 58348}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1552, col: 63, offset: 57034}, + pos: position{line: 1595, col: 63, offset: 58357}, name: "SinglePlusPassthroughContent", }, }, &ruleRefExpr{ - pos: position{line: 1552, col: 93, offset: 57064}, + pos: position{line: 1595, col: 93, offset: 58387}, name: "SinglePlusPassthroughPrefix", }, ¬Expr{ - pos: position{line: 1552, col: 121, offset: 57092}, + pos: position{line: 1595, col: 121, offset: 58415}, expr: &ruleRefExpr{ - pos: position{line: 1552, col: 122, offset: 57093}, + pos: position{line: 1595, col: 122, offset: 58416}, name: "Alphanum", }, }, @@ -11156,85 +10893,85 @@ var g = &grammar{ }, { name: "SinglePlusPassthroughContent", - pos: position{line: 1556, col: 1, offset: 57198}, + pos: position{line: 1599, col: 1, offset: 58521}, expr: &choiceExpr{ - pos: position{line: 1556, col: 33, offset: 57230}, + pos: position{line: 1599, col: 33, offset: 58553}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1556, col: 34, offset: 57231}, + pos: position{line: 1599, col: 34, offset: 58554}, run: (*parser).callonSinglePlusPassthroughContent2, expr: &seqExpr{ - pos: position{line: 1556, col: 34, offset: 57231}, + pos: position{line: 1599, col: 34, offset: 58554}, exprs: []interface{}{ &seqExpr{ - pos: position{line: 1556, col: 35, offset: 57232}, + pos: position{line: 1599, col: 35, offset: 58555}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1556, col: 35, offset: 57232}, + pos: position{line: 1599, col: 35, offset: 58555}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 36, offset: 57233}, + pos: position{line: 1599, col: 36, offset: 58556}, name: "SinglePlusPassthroughPrefix", }, }, ¬Expr{ - pos: position{line: 1556, col: 64, offset: 57261}, + pos: position{line: 1599, col: 64, offset: 58584}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 65, offset: 57262}, + pos: position{line: 1599, col: 65, offset: 58585}, name: "Space", }, }, ¬Expr{ - pos: position{line: 1556, col: 71, offset: 57268}, + pos: position{line: 1599, col: 71, offset: 58591}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 72, offset: 57269}, + pos: position{line: 1599, col: 72, offset: 58592}, name: "Newline", }, }, &anyMatcher{ - line: 1556, col: 80, offset: 57277, + line: 1599, col: 80, offset: 58600, }, }, }, &zeroOrMoreExpr{ - pos: position{line: 1556, col: 83, offset: 57280}, + pos: position{line: 1599, col: 83, offset: 58603}, expr: &seqExpr{ - pos: position{line: 1556, col: 84, offset: 57281}, + pos: position{line: 1599, col: 84, offset: 58604}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1556, col: 84, offset: 57281}, + pos: position{line: 1599, col: 84, offset: 58604}, expr: &seqExpr{ - pos: position{line: 1556, col: 86, offset: 57283}, + pos: position{line: 1599, col: 86, offset: 58606}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1556, col: 86, offset: 57283}, + pos: position{line: 1599, col: 86, offset: 58606}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 86, offset: 57283}, + pos: position{line: 1599, col: 86, offset: 58606}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1556, col: 93, offset: 57290}, + pos: position{line: 1599, col: 93, offset: 58613}, name: "SinglePlusPassthroughPrefix", }, }, }, }, ¬Expr{ - pos: position{line: 1556, col: 122, offset: 57319}, + pos: position{line: 1599, col: 122, offset: 58642}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 123, offset: 57320}, + pos: position{line: 1599, col: 123, offset: 58643}, name: "SinglePlusPassthroughPrefix", }, }, ¬Expr{ - pos: position{line: 1556, col: 151, offset: 57348}, + pos: position{line: 1599, col: 151, offset: 58671}, expr: &ruleRefExpr{ - pos: position{line: 1556, col: 152, offset: 57349}, + pos: position{line: 1599, col: 152, offset: 58672}, name: "Newline", }, }, &anyMatcher{ - line: 1556, col: 160, offset: 57357, + line: 1599, col: 160, offset: 58680, }, }, }, @@ -11243,34 +10980,34 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1558, col: 7, offset: 57499}, + pos: position{line: 1601, col: 7, offset: 58822}, run: (*parser).callonSinglePlusPassthroughContent24, expr: &seqExpr{ - pos: position{line: 1558, col: 8, offset: 57500}, + pos: position{line: 1601, col: 8, offset: 58823}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1558, col: 8, offset: 57500}, + pos: position{line: 1601, col: 8, offset: 58823}, expr: &ruleRefExpr{ - pos: position{line: 1558, col: 9, offset: 57501}, + pos: position{line: 1601, col: 9, offset: 58824}, name: "Space", }, }, ¬Expr{ - pos: position{line: 1558, col: 15, offset: 57507}, + pos: position{line: 1601, col: 15, offset: 58830}, expr: &ruleRefExpr{ - pos: position{line: 1558, col: 16, offset: 57508}, + pos: position{line: 1601, col: 16, offset: 58831}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 1558, col: 24, offset: 57516}, + pos: position{line: 1601, col: 24, offset: 58839}, expr: &ruleRefExpr{ - pos: position{line: 1558, col: 25, offset: 57517}, + pos: position{line: 1601, col: 25, offset: 58840}, name: "SinglePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1558, col: 53, offset: 57545, + line: 1601, col: 53, offset: 58868, }, }, }, @@ -11280,9 +11017,9 @@ var g = &grammar{ }, { name: "TriplePlusPassthroughPrefix", - pos: position{line: 1562, col: 1, offset: 57627}, + pos: position{line: 1605, col: 1, offset: 58950}, expr: &litMatcher{ - pos: position{line: 1562, col: 32, offset: 57658}, + pos: position{line: 1605, col: 32, offset: 58981}, val: "+++", ignoreCase: false, want: "\"+++\"", @@ -11290,33 +11027,33 @@ var g = &grammar{ }, { name: "TriplePlusPassthrough", - pos: position{line: 1564, col: 1, offset: 57665}, + pos: position{line: 1607, col: 1, offset: 58988}, expr: &actionExpr{ - pos: position{line: 1564, col: 26, offset: 57690}, + pos: position{line: 1607, col: 26, offset: 59013}, run: (*parser).callonTriplePlusPassthrough1, expr: &seqExpr{ - pos: position{line: 1564, col: 26, offset: 57690}, + pos: position{line: 1607, col: 26, offset: 59013}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1564, col: 26, offset: 57690}, + pos: position{line: 1607, col: 26, offset: 59013}, name: "TriplePlusPassthroughPrefix", }, &labeledExpr{ - pos: position{line: 1564, col: 54, offset: 57718}, + pos: position{line: 1607, col: 54, offset: 59041}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1564, col: 63, offset: 57727}, + pos: position{line: 1607, col: 63, offset: 59050}, name: "TriplePlusPassthroughContent", }, }, &ruleRefExpr{ - pos: position{line: 1564, col: 93, offset: 57757}, + pos: position{line: 1607, col: 93, offset: 59080}, name: "TriplePlusPassthroughPrefix", }, ¬Expr{ - pos: position{line: 1564, col: 121, offset: 57785}, + pos: position{line: 1607, col: 121, offset: 59108}, expr: &ruleRefExpr{ - pos: position{line: 1564, col: 122, offset: 57786}, + pos: position{line: 1607, col: 122, offset: 59109}, name: "Alphanum", }, }, @@ -11326,63 +11063,63 @@ var g = &grammar{ }, { name: "TriplePlusPassthroughContent", - pos: position{line: 1568, col: 1, offset: 57891}, + pos: position{line: 1611, col: 1, offset: 59214}, expr: &choiceExpr{ - pos: position{line: 1568, col: 33, offset: 57923}, + pos: position{line: 1611, col: 33, offset: 59246}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1568, col: 34, offset: 57924}, + pos: position{line: 1611, col: 34, offset: 59247}, run: (*parser).callonTriplePlusPassthroughContent2, expr: &zeroOrMoreExpr{ - pos: position{line: 1568, col: 34, offset: 57924}, + pos: position{line: 1611, col: 34, offset: 59247}, expr: &seqExpr{ - pos: position{line: 1568, col: 35, offset: 57925}, + pos: position{line: 1611, col: 35, offset: 59248}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1568, col: 35, offset: 57925}, + pos: position{line: 1611, col: 35, offset: 59248}, expr: &ruleRefExpr{ - pos: position{line: 1568, col: 36, offset: 57926}, + pos: position{line: 1611, col: 36, offset: 59249}, name: "TriplePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1568, col: 64, offset: 57954, + line: 1611, col: 64, offset: 59277, }, }, }, }, }, &actionExpr{ - pos: position{line: 1570, col: 7, offset: 58119}, + pos: position{line: 1613, col: 7, offset: 59442}, run: (*parser).callonTriplePlusPassthroughContent8, expr: &zeroOrOneExpr{ - pos: position{line: 1570, col: 7, offset: 58119}, + pos: position{line: 1613, col: 7, offset: 59442}, expr: &seqExpr{ - pos: position{line: 1570, col: 8, offset: 58120}, + pos: position{line: 1613, col: 8, offset: 59443}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1570, col: 8, offset: 58120}, + pos: position{line: 1613, col: 8, offset: 59443}, expr: &ruleRefExpr{ - pos: position{line: 1570, col: 9, offset: 58121}, + pos: position{line: 1613, col: 9, offset: 59444}, name: "Space", }, }, ¬Expr{ - pos: position{line: 1570, col: 15, offset: 58127}, + pos: position{line: 1613, col: 15, offset: 59450}, expr: &ruleRefExpr{ - pos: position{line: 1570, col: 16, offset: 58128}, + pos: position{line: 1613, col: 16, offset: 59451}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 1570, col: 24, offset: 58136}, + pos: position{line: 1613, col: 24, offset: 59459}, expr: &ruleRefExpr{ - pos: position{line: 1570, col: 25, offset: 58137}, + pos: position{line: 1613, col: 25, offset: 59460}, name: "TriplePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1570, col: 53, offset: 58165, + line: 1613, col: 53, offset: 59488, }, }, }, @@ -11393,35 +11130,35 @@ var g = &grammar{ }, { name: "PassthroughMacro", - pos: position{line: 1574, col: 1, offset: 58248}, + pos: position{line: 1617, col: 1, offset: 59571}, expr: &choiceExpr{ - pos: position{line: 1574, col: 21, offset: 58268}, + pos: position{line: 1617, col: 21, offset: 59591}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1574, col: 21, offset: 58268}, + pos: position{line: 1617, col: 21, offset: 59591}, run: (*parser).callonPassthroughMacro2, expr: &seqExpr{ - pos: position{line: 1574, col: 21, offset: 58268}, + pos: position{line: 1617, col: 21, offset: 59591}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1574, col: 21, offset: 58268}, + pos: position{line: 1617, col: 21, offset: 59591}, val: "pass:[", ignoreCase: false, want: "\"pass:[\"", }, &labeledExpr{ - pos: position{line: 1574, col: 30, offset: 58277}, + pos: position{line: 1617, col: 30, offset: 59600}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 1574, col: 38, offset: 58285}, + pos: position{line: 1617, col: 38, offset: 59608}, expr: &ruleRefExpr{ - pos: position{line: 1574, col: 39, offset: 58286}, + pos: position{line: 1617, col: 39, offset: 59609}, name: "PassthroughMacroCharacter", }, }, }, &litMatcher{ - pos: position{line: 1574, col: 67, offset: 58314}, + pos: position{line: 1617, col: 67, offset: 59637}, val: "]", ignoreCase: false, want: "\"]\"", @@ -11430,31 +11167,31 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1576, col: 5, offset: 58410}, + pos: position{line: 1619, col: 5, offset: 59733}, run: (*parser).callonPassthroughMacro9, expr: &seqExpr{ - pos: position{line: 1576, col: 5, offset: 58410}, + pos: position{line: 1619, col: 5, offset: 59733}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1576, col: 5, offset: 58410}, + pos: position{line: 1619, col: 5, offset: 59733}, val: "pass:q[", ignoreCase: false, want: "\"pass:q[\"", }, &labeledExpr{ - pos: position{line: 1576, col: 15, offset: 58420}, + pos: position{line: 1619, col: 15, offset: 59743}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 1576, col: 23, offset: 58428}, + pos: position{line: 1619, col: 23, offset: 59751}, expr: &choiceExpr{ - pos: position{line: 1576, col: 24, offset: 58429}, + pos: position{line: 1619, col: 24, offset: 59752}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1576, col: 24, offset: 58429}, + pos: position{line: 1619, col: 24, offset: 59752}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1576, col: 37, offset: 58442}, + pos: position{line: 1619, col: 37, offset: 59765}, name: "PassthroughMacroCharacter", }, }, @@ -11462,7 +11199,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1576, col: 65, offset: 58470}, + pos: position{line: 1619, col: 65, offset: 59793}, val: "]", ignoreCase: false, want: "\"]\"", @@ -11475,12 +11212,12 @@ var g = &grammar{ }, { name: "PassthroughMacroCharacter", - pos: position{line: 1580, col: 1, offset: 58566}, + pos: position{line: 1623, col: 1, offset: 59889}, expr: &actionExpr{ - pos: position{line: 1580, col: 30, offset: 58595}, + pos: position{line: 1623, col: 30, offset: 59918}, run: (*parser).callonPassthroughMacroCharacter1, expr: &charClassMatcher{ - pos: position{line: 1580, col: 30, offset: 58595}, + pos: position{line: 1623, col: 30, offset: 59918}, val: "[^\\]]", chars: []rune{']'}, ignoreCase: false, @@ -11490,16 +11227,16 @@ var g = &grammar{ }, { name: "CrossReference", - pos: position{line: 1587, col: 1, offset: 58768}, + pos: position{line: 1630, col: 1, offset: 60091}, expr: &choiceExpr{ - pos: position{line: 1587, col: 19, offset: 58786}, + pos: position{line: 1630, col: 19, offset: 60109}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1587, col: 19, offset: 58786}, + pos: position{line: 1630, col: 19, offset: 60109}, name: "InternalCrossReference", }, &ruleRefExpr{ - pos: position{line: 1587, col: 44, offset: 58811}, + pos: position{line: 1630, col: 44, offset: 60134}, name: "ExternalCrossReference", }, }, @@ -11507,53 +11244,53 @@ var g = &grammar{ }, { name: "InternalCrossReference", - pos: position{line: 1589, col: 1, offset: 58836}, + pos: position{line: 1632, col: 1, offset: 60159}, expr: &choiceExpr{ - pos: position{line: 1589, col: 27, offset: 58862}, + pos: position{line: 1632, col: 27, offset: 60185}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1589, col: 27, offset: 58862}, + pos: position{line: 1632, col: 27, offset: 60185}, run: (*parser).callonInternalCrossReference2, expr: &seqExpr{ - pos: position{line: 1589, col: 27, offset: 58862}, + pos: position{line: 1632, col: 27, offset: 60185}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1589, col: 27, offset: 58862}, + pos: position{line: 1632, col: 27, offset: 60185}, val: "<<", ignoreCase: false, want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1589, col: 32, offset: 58867}, + pos: position{line: 1632, col: 32, offset: 60190}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 1589, col: 36, offset: 58871}, + pos: position{line: 1632, col: 36, offset: 60194}, name: "ID", }, }, &zeroOrMoreExpr{ - pos: position{line: 1589, col: 40, offset: 58875}, + pos: position{line: 1632, col: 40, offset: 60198}, expr: &ruleRefExpr{ - pos: position{line: 1589, col: 40, offset: 58875}, + pos: position{line: 1632, col: 40, offset: 60198}, name: "Space", }, }, &litMatcher{ - pos: position{line: 1589, col: 47, offset: 58882}, + pos: position{line: 1632, col: 47, offset: 60205}, val: ",", ignoreCase: false, want: "\",\"", }, &labeledExpr{ - pos: position{line: 1589, col: 51, offset: 58886}, + pos: position{line: 1632, col: 51, offset: 60209}, label: "label", expr: &ruleRefExpr{ - pos: position{line: 1589, col: 58, offset: 58893}, + pos: position{line: 1632, col: 58, offset: 60216}, name: "CrossReferenceLabel", }, }, &litMatcher{ - pos: position{line: 1589, col: 79, offset: 58914}, + pos: position{line: 1632, col: 79, offset: 60237}, val: ">>", ignoreCase: false, want: "\">>\"", @@ -11562,27 +11299,27 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1591, col: 5, offset: 58997}, + pos: position{line: 1634, col: 5, offset: 60320}, run: (*parser).callonInternalCrossReference13, expr: &seqExpr{ - pos: position{line: 1591, col: 5, offset: 58997}, + pos: position{line: 1634, col: 5, offset: 60320}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1591, col: 5, offset: 58997}, + pos: position{line: 1634, col: 5, offset: 60320}, val: "<<", ignoreCase: false, want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1591, col: 10, offset: 59002}, + pos: position{line: 1634, col: 10, offset: 60325}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 1591, col: 14, offset: 59006}, + pos: position{line: 1634, col: 14, offset: 60329}, name: "ID", }, }, &litMatcher{ - pos: position{line: 1591, col: 18, offset: 59010}, + pos: position{line: 1634, col: 18, offset: 60333}, val: ">>", ignoreCase: false, want: "\">>\"", @@ -11595,32 +11332,32 @@ var g = &grammar{ }, { name: "ExternalCrossReference", - pos: position{line: 1595, col: 1, offset: 59082}, + pos: position{line: 1638, col: 1, offset: 60405}, expr: &actionExpr{ - pos: position{line: 1595, col: 27, offset: 59108}, + pos: position{line: 1638, col: 27, offset: 60431}, run: (*parser).callonExternalCrossReference1, expr: &seqExpr{ - pos: position{line: 1595, col: 27, offset: 59108}, + pos: position{line: 1638, col: 27, offset: 60431}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1595, col: 27, offset: 59108}, + pos: position{line: 1638, col: 27, offset: 60431}, val: "xref:", ignoreCase: false, want: "\"xref:\"", }, &labeledExpr{ - pos: position{line: 1595, col: 35, offset: 59116}, + pos: position{line: 1638, col: 35, offset: 60439}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1595, col: 40, offset: 59121}, + pos: position{line: 1638, col: 40, offset: 60444}, name: "FileLocation", }, }, &labeledExpr{ - pos: position{line: 1595, col: 54, offset: 59135}, + pos: position{line: 1638, col: 54, offset: 60458}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1595, col: 72, offset: 59153}, + pos: position{line: 1638, col: 72, offset: 60476}, name: "LinkAttributes", }, }, @@ -11630,24 +11367,24 @@ var g = &grammar{ }, { name: "CrossReferenceLabel", - pos: position{line: 1599, col: 1, offset: 59276}, + pos: position{line: 1642, col: 1, offset: 60599}, expr: &ruleRefExpr{ - pos: position{line: 1599, col: 24, offset: 59299}, + pos: position{line: 1642, col: 24, offset: 60622}, name: "ElementTitleContent", }, }, { name: "Link", - pos: position{line: 1604, col: 1, offset: 59421}, + pos: position{line: 1647, col: 1, offset: 60744}, expr: &choiceExpr{ - pos: position{line: 1604, col: 9, offset: 59429}, + pos: position{line: 1647, col: 9, offset: 60752}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1604, col: 9, offset: 59429}, + pos: position{line: 1647, col: 9, offset: 60752}, name: "RelativeLink", }, &ruleRefExpr{ - pos: position{line: 1604, col: 24, offset: 59444}, + pos: position{line: 1647, col: 24, offset: 60767}, name: "ExternalLink", }, }, @@ -11655,32 +11392,32 @@ var g = &grammar{ }, { name: "RelativeLink", - pos: position{line: 1607, col: 1, offset: 59525}, + pos: position{line: 1650, col: 1, offset: 60848}, expr: &actionExpr{ - pos: position{line: 1607, col: 17, offset: 59541}, + pos: position{line: 1650, col: 17, offset: 60864}, run: (*parser).callonRelativeLink1, expr: &seqExpr{ - pos: position{line: 1607, col: 17, offset: 59541}, + pos: position{line: 1650, col: 17, offset: 60864}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1607, col: 17, offset: 59541}, + pos: position{line: 1650, col: 17, offset: 60864}, val: "link:", ignoreCase: false, want: "\"link:\"", }, &labeledExpr{ - pos: position{line: 1607, col: 25, offset: 59549}, + pos: position{line: 1650, col: 25, offset: 60872}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1607, col: 30, offset: 59554}, + pos: position{line: 1650, col: 30, offset: 60877}, name: "Location", }, }, &labeledExpr{ - pos: position{line: 1607, col: 40, offset: 59564}, + pos: position{line: 1650, col: 40, offset: 60887}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1607, col: 58, offset: 59582}, + pos: position{line: 1650, col: 58, offset: 60905}, name: "LinkAttributes", }, }, @@ -11690,28 +11427,28 @@ var g = &grammar{ }, { name: "ExternalLink", - pos: position{line: 1611, col: 1, offset: 59693}, + pos: position{line: 1654, col: 1, offset: 61016}, expr: &actionExpr{ - pos: position{line: 1611, col: 17, offset: 59709}, + pos: position{line: 1654, col: 17, offset: 61032}, run: (*parser).callonExternalLink1, expr: &seqExpr{ - pos: position{line: 1611, col: 17, offset: 59709}, + pos: position{line: 1654, col: 17, offset: 61032}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1611, col: 17, offset: 59709}, + pos: position{line: 1654, col: 17, offset: 61032}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1611, col: 22, offset: 59714}, + pos: position{line: 1654, col: 22, offset: 61037}, name: "LocationWithScheme", }, }, &labeledExpr{ - pos: position{line: 1611, col: 42, offset: 59734}, + pos: position{line: 1654, col: 42, offset: 61057}, label: "inlineAttributes", expr: &zeroOrOneExpr{ - pos: position{line: 1611, col: 59, offset: 59751}, + pos: position{line: 1654, col: 59, offset: 61074}, expr: &ruleRefExpr{ - pos: position{line: 1611, col: 60, offset: 59752}, + pos: position{line: 1654, col: 60, offset: 61075}, name: "LinkAttributes", }, }, @@ -11722,50 +11459,50 @@ var g = &grammar{ }, { name: "LinkAttributes", - pos: position{line: 1615, col: 1, offset: 59845}, + pos: position{line: 1658, col: 1, offset: 61168}, expr: &actionExpr{ - pos: position{line: 1615, col: 19, offset: 59863}, + pos: position{line: 1658, col: 19, offset: 61186}, run: (*parser).callonLinkAttributes1, expr: &seqExpr{ - pos: position{line: 1615, col: 19, offset: 59863}, + pos: position{line: 1658, col: 19, offset: 61186}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1615, col: 19, offset: 59863}, + pos: position{line: 1658, col: 19, offset: 61186}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1615, col: 23, offset: 59867}, + pos: position{line: 1658, col: 23, offset: 61190}, label: "firstAttr", expr: &zeroOrMoreExpr{ - pos: position{line: 1615, col: 33, offset: 59877}, + pos: position{line: 1658, col: 33, offset: 61200}, expr: &ruleRefExpr{ - pos: position{line: 1615, col: 34, offset: 59878}, + pos: position{line: 1658, col: 34, offset: 61201}, name: "FirstLinkAttributeElement", }, }, }, &zeroOrMoreExpr{ - pos: position{line: 1616, col: 5, offset: 59910}, + pos: position{line: 1659, col: 5, offset: 61233}, expr: &ruleRefExpr{ - pos: position{line: 1616, col: 5, offset: 59910}, + pos: position{line: 1659, col: 5, offset: 61233}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 1616, col: 12, offset: 59917}, + pos: position{line: 1659, col: 12, offset: 61240}, label: "otherattrs", expr: &zeroOrMoreExpr{ - pos: position{line: 1616, col: 23, offset: 59928}, + pos: position{line: 1659, col: 23, offset: 61251}, expr: &ruleRefExpr{ - pos: position{line: 1616, col: 24, offset: 59929}, + pos: position{line: 1659, col: 24, offset: 61252}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 1616, col: 43, offset: 59948}, + pos: position{line: 1659, col: 43, offset: 61271}, val: "]", ignoreCase: false, want: "\"]\"", @@ -11776,46 +11513,50 @@ var g = &grammar{ }, { name: "FirstLinkAttributeElement", - pos: position{line: 1620, col: 1, offset: 60065}, + pos: position{line: 1663, col: 1, offset: 61388}, expr: &actionExpr{ - pos: position{line: 1620, col: 30, offset: 60094}, + pos: position{line: 1663, col: 30, offset: 61417}, run: (*parser).callonFirstLinkAttributeElement1, expr: &labeledExpr{ - pos: position{line: 1620, col: 30, offset: 60094}, + pos: position{line: 1663, col: 30, offset: 61417}, label: "element", expr: &choiceExpr{ - pos: position{line: 1622, col: 5, offset: 60145}, + pos: position{line: 1665, col: 5, offset: 61468}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1622, col: 6, offset: 60146}, + pos: position{line: 1665, col: 6, offset: 61469}, run: (*parser).callonFirstLinkAttributeElement4, expr: &seqExpr{ - pos: position{line: 1622, col: 6, offset: 60146}, + pos: position{line: 1665, col: 6, offset: 61469}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1622, col: 6, offset: 60146}, + pos: position{line: 1665, col: 6, offset: 61469}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 1622, col: 11, offset: 60151}, + pos: position{line: 1665, col: 11, offset: 61474}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1622, col: 20, offset: 60160}, + pos: position{line: 1665, col: 20, offset: 61483}, expr: &choiceExpr{ - pos: position{line: 1622, col: 21, offset: 60161}, + pos: position{line: 1665, col: 21, offset: 61484}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1622, col: 21, offset: 60161}, + pos: position{line: 1665, col: 21, offset: 61484}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 1622, col: 36, offset: 60176}, + pos: position{line: 1665, col: 36, offset: 61499}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1622, col: 49, offset: 60189}, + pos: position{line: 1665, col: 49, offset: 61512}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1665, col: 70, offset: 61533}, name: "QuotedAttributeChar", }, }, @@ -11823,17 +11564,17 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1622, col: 71, offset: 60211}, + pos: position{line: 1665, col: 92, offset: 61555}, val: "\"", ignoreCase: false, want: "\"\\\"\"", }, &andExpr{ - pos: position{line: 1622, col: 76, offset: 60216}, + pos: position{line: 1665, col: 97, offset: 61560}, expr: ¬Expr{ - pos: position{line: 1622, col: 78, offset: 60218}, + pos: position{line: 1665, col: 99, offset: 61562}, expr: &litMatcher{ - pos: position{line: 1622, col: 79, offset: 60219}, + pos: position{line: 1665, col: 100, offset: 61563}, val: "=", ignoreCase: false, want: "\"=\"", @@ -11841,9 +11582,9 @@ var g = &grammar{ }, }, &zeroOrOneExpr{ - pos: position{line: 1622, col: 84, offset: 60224}, + pos: position{line: 1665, col: 105, offset: 61568}, expr: &litMatcher{ - pos: position{line: 1622, col: 84, offset: 60224}, + pos: position{line: 1665, col: 105, offset: 61568}, val: ",", ignoreCase: false, want: "\",\"", @@ -11853,29 +11594,33 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1626, col: 6, offset: 60351}, - run: (*parser).callonFirstLinkAttributeElement19, + pos: position{line: 1669, col: 6, offset: 61695}, + run: (*parser).callonFirstLinkAttributeElement20, expr: &seqExpr{ - pos: position{line: 1626, col: 6, offset: 60351}, + pos: position{line: 1669, col: 6, offset: 61695}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1626, col: 6, offset: 60351}, + pos: position{line: 1669, col: 6, offset: 61695}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1626, col: 15, offset: 60360}, + pos: position{line: 1669, col: 15, offset: 61704}, expr: &choiceExpr{ - pos: position{line: 1626, col: 16, offset: 60361}, + pos: position{line: 1669, col: 16, offset: 61705}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1626, col: 16, offset: 60361}, + pos: position{line: 1669, col: 16, offset: 61705}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 1626, col: 31, offset: 60376}, + pos: position{line: 1669, col: 31, offset: 61720}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1626, col: 44, offset: 60389}, + pos: position{line: 1669, col: 44, offset: 61733}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1669, col: 65, offset: 61754}, name: "UnquotedAttributeChar", }, }, @@ -11883,11 +11628,11 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 1626, col: 68, offset: 60413}, + pos: position{line: 1669, col: 89, offset: 61778}, expr: ¬Expr{ - pos: position{line: 1626, col: 70, offset: 60415}, + pos: position{line: 1669, col: 91, offset: 61780}, expr: &litMatcher{ - pos: position{line: 1626, col: 71, offset: 60416}, + pos: position{line: 1669, col: 92, offset: 61781}, val: "=", ignoreCase: false, want: "\"=\"", @@ -11895,9 +11640,9 @@ var g = &grammar{ }, }, &zeroOrOneExpr{ - pos: position{line: 1626, col: 76, offset: 60421}, + pos: position{line: 1669, col: 97, offset: 61786}, expr: &litMatcher{ - pos: position{line: 1626, col: 76, offset: 60421}, + pos: position{line: 1669, col: 97, offset: 61786}, val: ",", ignoreCase: false, want: "\",\"", @@ -11913,12 +11658,12 @@ var g = &grammar{ }, { name: "AttributeChar", - pos: position{line: 1632, col: 1, offset: 60535}, + pos: position{line: 1675, col: 1, offset: 61900}, expr: &actionExpr{ - pos: position{line: 1632, col: 18, offset: 60552}, + pos: position{line: 1675, col: 18, offset: 61917}, run: (*parser).callonAttributeChar1, expr: &charClassMatcher{ - pos: position{line: 1632, col: 18, offset: 60552}, + pos: position{line: 1675, col: 18, offset: 61917}, val: "[^\\r\\n\"=\\],]", chars: []rune{'\r', '\n', '"', '=', ']', ','}, ignoreCase: false, @@ -11928,12 +11673,12 @@ var g = &grammar{ }, { name: "QuotedAttributeChar", - pos: position{line: 1636, col: 1, offset: 60638}, + pos: position{line: 1679, col: 1, offset: 62003}, expr: &actionExpr{ - pos: position{line: 1636, col: 24, offset: 60661}, + pos: position{line: 1679, col: 24, offset: 62026}, run: (*parser).callonQuotedAttributeChar1, expr: &charClassMatcher{ - pos: position{line: 1636, col: 24, offset: 60661}, + pos: position{line: 1679, col: 24, offset: 62026}, val: "[^\\r\\n\"=\\]]", chars: []rune{'\r', '\n', '"', '=', ']'}, ignoreCase: false, @@ -11943,12 +11688,12 @@ var g = &grammar{ }, { name: "UnquotedAttributeChar", - pos: position{line: 1640, col: 1, offset: 60754}, + pos: position{line: 1683, col: 1, offset: 62119}, expr: &actionExpr{ - pos: position{line: 1640, col: 26, offset: 60779}, + pos: position{line: 1683, col: 26, offset: 62144}, run: (*parser).callonUnquotedAttributeChar1, expr: &charClassMatcher{ - pos: position{line: 1640, col: 26, offset: 60779}, + pos: position{line: 1683, col: 26, offset: 62144}, val: "[^\\r\\n\"=\\],]", chars: []rune{'\r', '\n', '"', '=', ']', ','}, ignoreCase: false, @@ -11958,54 +11703,54 @@ var g = &grammar{ }, { name: "InlineLinks", - pos: position{line: 1645, col: 1, offset: 60935}, + pos: position{line: 1688, col: 1, offset: 62300}, expr: &actionExpr{ - pos: position{line: 1646, col: 5, offset: 60954}, + pos: position{line: 1689, col: 5, offset: 62319}, run: (*parser).callonInlineLinks1, expr: &seqExpr{ - pos: position{line: 1646, col: 5, offset: 60954}, + pos: position{line: 1689, col: 5, offset: 62319}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1646, col: 5, offset: 60954}, + pos: position{line: 1689, col: 5, offset: 62319}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1646, col: 14, offset: 60963}, + pos: position{line: 1689, col: 14, offset: 62328}, expr: &choiceExpr{ - pos: position{line: 1646, col: 15, offset: 60964}, + pos: position{line: 1689, col: 15, offset: 62329}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1646, col: 15, offset: 60964}, + pos: position{line: 1689, col: 15, offset: 62329}, name: "Word", }, &ruleRefExpr{ - pos: position{line: 1647, col: 11, offset: 60979}, + pos: position{line: 1690, col: 11, offset: 62344}, name: "SpecialCharacter", }, &oneOrMoreExpr{ - pos: position{line: 1648, col: 11, offset: 61006}, + pos: position{line: 1691, col: 11, offset: 62371}, expr: &ruleRefExpr{ - pos: position{line: 1648, col: 11, offset: 61006}, + pos: position{line: 1691, col: 11, offset: 62371}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1649, col: 11, offset: 61024}, + pos: position{line: 1692, col: 11, offset: 62389}, name: "ResolvedLink", }, &ruleRefExpr{ - pos: position{line: 1650, col: 11, offset: 61048}, + pos: position{line: 1693, col: 11, offset: 62413}, name: "Parenthesis", }, &ruleRefExpr{ - pos: position{line: 1651, col: 11, offset: 61070}, + pos: position{line: 1694, col: 11, offset: 62452}, name: "ImpliedApostrophe", }, &ruleRefExpr{ - pos: position{line: 1652, col: 11, offset: 61098}, + pos: position{line: 1695, col: 11, offset: 62497}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 1653, col: 11, offset: 61116}, + pos: position{line: 1696, col: 11, offset: 62515}, name: "Newline", }, }, @@ -12013,7 +11758,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1653, col: 21, offset: 61126}, + pos: position{line: 1696, col: 21, offset: 62525}, name: "EOF", }, }, @@ -12022,16 +11767,16 @@ var g = &grammar{ }, { name: "ResolvedLink", - pos: position{line: 1657, col: 1, offset: 61196}, + pos: position{line: 1700, col: 1, offset: 62595}, expr: &choiceExpr{ - pos: position{line: 1657, col: 17, offset: 61212}, + pos: position{line: 1700, col: 17, offset: 62611}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1657, col: 17, offset: 61212}, + pos: position{line: 1700, col: 17, offset: 62611}, name: "ResolvedRelativeLink", }, &ruleRefExpr{ - pos: position{line: 1657, col: 40, offset: 61235}, + pos: position{line: 1700, col: 40, offset: 62634}, name: "ResolvedExternalLink", }, }, @@ -12039,41 +11784,41 @@ var g = &grammar{ }, { name: "ResolvedRelativeLink", - pos: position{line: 1660, col: 1, offset: 61363}, + pos: position{line: 1703, col: 1, offset: 62762}, expr: &actionExpr{ - pos: position{line: 1660, col: 25, offset: 61387}, + pos: position{line: 1703, col: 25, offset: 62786}, run: (*parser).callonResolvedRelativeLink1, expr: &seqExpr{ - pos: position{line: 1660, col: 25, offset: 61387}, + pos: position{line: 1703, col: 25, offset: 62786}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1660, col: 25, offset: 61387}, + pos: position{line: 1703, col: 25, offset: 62786}, val: "link:", ignoreCase: false, want: "\"link:\"", }, &labeledExpr{ - pos: position{line: 1660, col: 33, offset: 61395}, + pos: position{line: 1703, col: 33, offset: 62794}, label: "url", expr: &choiceExpr{ - pos: position{line: 1660, col: 38, offset: 61400}, + pos: position{line: 1703, col: 38, offset: 62799}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1660, col: 38, offset: 61400}, + pos: position{line: 1703, col: 38, offset: 62799}, name: "ResolvedLocation", }, &ruleRefExpr{ - pos: position{line: 1660, col: 57, offset: 61419}, + pos: position{line: 1703, col: 57, offset: 62818}, name: "ResolvedFileLocation", }, }, }, }, &labeledExpr{ - pos: position{line: 1660, col: 79, offset: 61441}, + pos: position{line: 1703, col: 79, offset: 62840}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1660, col: 97, offset: 61459}, + pos: position{line: 1703, col: 97, offset: 62858}, name: "LinkAttributes", }, }, @@ -12083,28 +11828,28 @@ var g = &grammar{ }, { name: "ResolvedExternalLink", - pos: position{line: 1664, col: 1, offset: 61570}, + pos: position{line: 1707, col: 1, offset: 62969}, expr: &actionExpr{ - pos: position{line: 1664, col: 25, offset: 61594}, + pos: position{line: 1707, col: 25, offset: 62993}, run: (*parser).callonResolvedExternalLink1, expr: &seqExpr{ - pos: position{line: 1664, col: 25, offset: 61594}, + pos: position{line: 1707, col: 25, offset: 62993}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1664, col: 25, offset: 61594}, + pos: position{line: 1707, col: 25, offset: 62993}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1664, col: 30, offset: 61599}, + pos: position{line: 1707, col: 30, offset: 62998}, name: "ResolvedLocation", }, }, &labeledExpr{ - pos: position{line: 1664, col: 48, offset: 61617}, + pos: position{line: 1707, col: 48, offset: 63016}, label: "inlineAttributes", expr: &zeroOrOneExpr{ - pos: position{line: 1664, col: 65, offset: 61634}, + pos: position{line: 1707, col: 65, offset: 63033}, expr: &ruleRefExpr{ - pos: position{line: 1664, col: 66, offset: 61635}, + pos: position{line: 1707, col: 66, offset: 63034}, name: "LinkAttributes", }, }, @@ -12115,55 +11860,55 @@ var g = &grammar{ }, { name: "ImageBlock", - pos: position{line: 1671, col: 1, offset: 61830}, + pos: position{line: 1714, col: 1, offset: 63229}, expr: &actionExpr{ - pos: position{line: 1671, col: 15, offset: 61844}, + pos: position{line: 1714, col: 15, offset: 63243}, run: (*parser).callonImageBlock1, expr: &seqExpr{ - pos: position{line: 1671, col: 15, offset: 61844}, + pos: position{line: 1714, col: 15, offset: 63243}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1671, col: 15, offset: 61844}, + pos: position{line: 1714, col: 15, offset: 63243}, label: "attributes", expr: &zeroOrMoreExpr{ - pos: position{line: 1671, col: 26, offset: 61855}, + pos: position{line: 1714, col: 26, offset: 63254}, expr: &ruleRefExpr{ - pos: position{line: 1671, col: 27, offset: 61856}, + pos: position{line: 1714, col: 27, offset: 63255}, name: "BlockImageAttrs", }, }, }, &litMatcher{ - pos: position{line: 1671, col: 45, offset: 61874}, + pos: position{line: 1714, col: 45, offset: 63273}, val: "image::", ignoreCase: false, want: "\"image::\"", }, &labeledExpr{ - pos: position{line: 1671, col: 55, offset: 61884}, + pos: position{line: 1714, col: 55, offset: 63283}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 1671, col: 61, offset: 61890}, + pos: position{line: 1714, col: 61, offset: 63289}, name: "Location", }, }, &labeledExpr{ - pos: position{line: 1671, col: 71, offset: 61900}, + pos: position{line: 1714, col: 71, offset: 63299}, label: "inlineAttrs", expr: &ruleRefExpr{ - pos: position{line: 1671, col: 84, offset: 61913}, + pos: position{line: 1714, col: 84, offset: 63312}, name: "InlineImageAttrs", }, }, &zeroOrMoreExpr{ - pos: position{line: 1671, col: 102, offset: 61931}, + pos: position{line: 1714, col: 102, offset: 63330}, expr: &ruleRefExpr{ - pos: position{line: 1671, col: 102, offset: 61931}, + pos: position{line: 1714, col: 102, offset: 63330}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1671, col: 109, offset: 61938}, + pos: position{line: 1714, col: 109, offset: 63337}, name: "EOL", }, }, @@ -12172,41 +11917,41 @@ var g = &grammar{ }, { name: "InlineImage", - pos: position{line: 1675, col: 1, offset: 62045}, + pos: position{line: 1719, col: 1, offset: 63547}, expr: &actionExpr{ - pos: position{line: 1675, col: 16, offset: 62060}, + pos: position{line: 1719, col: 16, offset: 63562}, run: (*parser).callonInlineImage1, expr: &seqExpr{ - pos: position{line: 1675, col: 16, offset: 62060}, + pos: position{line: 1719, col: 16, offset: 63562}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1675, col: 16, offset: 62060}, + pos: position{line: 1719, col: 16, offset: 63562}, val: "image:", ignoreCase: false, want: "\"image:\"", }, ¬Expr{ - pos: position{line: 1675, col: 25, offset: 62069}, + pos: position{line: 1719, col: 25, offset: 63571}, expr: &litMatcher{ - pos: position{line: 1675, col: 26, offset: 62070}, + pos: position{line: 1719, col: 26, offset: 63572}, val: ":", ignoreCase: false, want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 1675, col: 30, offset: 62074}, + pos: position{line: 1719, col: 30, offset: 63576}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 1675, col: 36, offset: 62080}, + pos: position{line: 1719, col: 36, offset: 63582}, name: "Location", }, }, &labeledExpr{ - pos: position{line: 1675, col: 46, offset: 62090}, + pos: position{line: 1719, col: 46, offset: 63592}, label: "inlineAttrs", expr: &ruleRefExpr{ - pos: position{line: 1675, col: 59, offset: 62103}, + pos: position{line: 1719, col: 59, offset: 63605}, name: "InlineImageAttrs", }, }, @@ -12216,53 +11961,53 @@ var g = &grammar{ }, { name: "InlineImageAttrs", - pos: position{line: 1679, col: 1, offset: 62213}, + pos: position{line: 1723, col: 1, offset: 63743}, expr: &actionExpr{ - pos: position{line: 1679, col: 21, offset: 62233}, + pos: position{line: 1723, col: 21, offset: 63763}, run: (*parser).callonInlineImageAttrs1, expr: &seqExpr{ - pos: position{line: 1679, col: 21, offset: 62233}, + pos: position{line: 1723, col: 21, offset: 63763}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1679, col: 21, offset: 62233}, + pos: position{line: 1723, col: 21, offset: 63763}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1679, col: 25, offset: 62237}, + pos: position{line: 1723, col: 25, offset: 63767}, label: "alt", expr: &ruleRefExpr{ - pos: position{line: 1679, col: 29, offset: 62241}, + pos: position{line: 1723, col: 29, offset: 63771}, name: "ImageAltInline", }, }, &labeledExpr{ - pos: position{line: 1679, col: 44, offset: 62256}, + pos: position{line: 1723, col: 44, offset: 63786}, label: "w", expr: &ruleRefExpr{ - pos: position{line: 1679, col: 46, offset: 62258}, + pos: position{line: 1723, col: 46, offset: 63788}, name: "ImageWidth", }, }, &labeledExpr{ - pos: position{line: 1679, col: 57, offset: 62269}, + pos: position{line: 1723, col: 57, offset: 63799}, label: "h", expr: &ruleRefExpr{ - pos: position{line: 1679, col: 59, offset: 62271}, + pos: position{line: 1723, col: 59, offset: 63801}, name: "ImageHeight", }, }, &labeledExpr{ - pos: position{line: 1679, col: 71, offset: 62283}, + pos: position{line: 1723, col: 71, offset: 63813}, label: "nv", expr: &ruleRefExpr{ - pos: position{line: 1679, col: 74, offset: 62286}, + pos: position{line: 1723, col: 74, offset: 63816}, name: "NamedAttrs", }, }, &litMatcher{ - pos: position{line: 1679, col: 85, offset: 62297}, + pos: position{line: 1723, col: 85, offset: 63827}, val: "]", ignoreCase: false, want: "\"]\"", @@ -12273,20 +12018,20 @@ var g = &grammar{ }, { name: "BlockImageAttrs", - pos: position{line: 1683, col: 1, offset: 62359}, + pos: position{line: 1727, col: 1, offset: 63889}, expr: &choiceExpr{ - pos: position{line: 1683, col: 20, offset: 62378}, + pos: position{line: 1727, col: 20, offset: 63908}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1683, col: 20, offset: 62378}, + pos: position{line: 1727, col: 20, offset: 63908}, name: "ImageAttrList", }, &ruleRefExpr{ - pos: position{line: 1683, col: 36, offset: 62394}, + pos: position{line: 1727, col: 36, offset: 63924}, name: "ElementTitle", }, &ruleRefExpr{ - pos: position{line: 1683, col: 51, offset: 62409}, + pos: position{line: 1727, col: 51, offset: 63939}, name: "ElementID", }, }, @@ -12294,57 +12039,57 @@ var g = &grammar{ }, { name: "ImageAttrList", - pos: position{line: 1685, col: 1, offset: 62420}, + pos: position{line: 1729, col: 1, offset: 63950}, expr: &actionExpr{ - pos: position{line: 1685, col: 18, offset: 62437}, + pos: position{line: 1729, col: 18, offset: 63967}, run: (*parser).callonImageAttrList1, expr: &seqExpr{ - pos: position{line: 1685, col: 18, offset: 62437}, + pos: position{line: 1729, col: 18, offset: 63967}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1685, col: 18, offset: 62437}, + pos: position{line: 1729, col: 18, offset: 63967}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1685, col: 22, offset: 62441}, + pos: position{line: 1729, col: 22, offset: 63971}, label: "attrs", expr: &seqExpr{ - pos: position{line: 1685, col: 29, offset: 62448}, + pos: position{line: 1729, col: 29, offset: 63978}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 1685, col: 29, offset: 62448}, + pos: position{line: 1729, col: 29, offset: 63978}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 29, offset: 62448}, + pos: position{line: 1729, col: 29, offset: 63978}, name: "ImageAltAttr", }, }, &zeroOrMoreExpr{ - pos: position{line: 1685, col: 43, offset: 62462}, + pos: position{line: 1729, col: 43, offset: 63992}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 43, offset: 62462}, + pos: position{line: 1729, col: 43, offset: 63992}, name: "ShortHandAttr", }, }, &zeroOrOneExpr{ - pos: position{line: 1685, col: 58, offset: 62477}, + pos: position{line: 1729, col: 58, offset: 64007}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 58, offset: 62477}, + pos: position{line: 1729, col: 58, offset: 64007}, name: "ImageWidthAttr", }, }, &zeroOrOneExpr{ - pos: position{line: 1685, col: 74, offset: 62493}, + pos: position{line: 1729, col: 74, offset: 64023}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 74, offset: 62493}, + pos: position{line: 1729, col: 74, offset: 64023}, name: "ImageHeightAttr", }, }, &zeroOrMoreExpr{ - pos: position{line: 1685, col: 91, offset: 62510}, + pos: position{line: 1729, col: 91, offset: 64040}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 91, offset: 62510}, + pos: position{line: 1729, col: 91, offset: 64040}, name: "NamedAttr", }, }, @@ -12352,20 +12097,20 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1685, col: 103, offset: 62522}, + pos: position{line: 1729, col: 103, offset: 64052}, val: "]", ignoreCase: false, want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 1685, col: 107, offset: 62526}, + pos: position{line: 1729, col: 107, offset: 64056}, expr: &ruleRefExpr{ - pos: position{line: 1685, col: 107, offset: 62526}, + pos: position{line: 1729, col: 107, offset: 64056}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1685, col: 114, offset: 62533}, + pos: position{line: 1729, col: 114, offset: 64063}, name: "EOL", }, }, @@ -12374,17 +12119,17 @@ var g = &grammar{ }, { name: "ImageAltInline", - pos: position{line: 1689, col: 1, offset: 62587}, + pos: position{line: 1733, col: 1, offset: 64117}, expr: &actionExpr{ - pos: position{line: 1689, col: 19, offset: 62605}, + pos: position{line: 1733, col: 19, offset: 64135}, run: (*parser).callonImageAltInline1, expr: &labeledExpr{ - pos: position{line: 1689, col: 19, offset: 62605}, + pos: position{line: 1733, col: 19, offset: 64135}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1689, col: 25, offset: 62611}, + pos: position{line: 1733, col: 25, offset: 64141}, expr: &ruleRefExpr{ - pos: position{line: 1689, col: 25, offset: 62611}, + pos: position{line: 1733, col: 25, offset: 64141}, name: "InlineVal", }, }, @@ -12393,29 +12138,29 @@ var g = &grammar{ }, { name: "ImageWidth", - pos: position{line: 1693, col: 1, offset: 62690}, + pos: position{line: 1737, col: 1, offset: 64220}, expr: &actionExpr{ - pos: position{line: 1693, col: 15, offset: 62704}, + pos: position{line: 1737, col: 15, offset: 64234}, run: (*parser).callonImageWidth1, expr: &seqExpr{ - pos: position{line: 1693, col: 15, offset: 62704}, + pos: position{line: 1737, col: 15, offset: 64234}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 1693, col: 15, offset: 62704}, + pos: position{line: 1737, col: 15, offset: 64234}, expr: &litMatcher{ - pos: position{line: 1693, col: 15, offset: 62704}, + pos: position{line: 1737, col: 15, offset: 64234}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 1693, col: 20, offset: 62709}, + pos: position{line: 1737, col: 20, offset: 64239}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1693, col: 26, offset: 62715}, + pos: position{line: 1737, col: 26, offset: 64245}, expr: &ruleRefExpr{ - pos: position{line: 1693, col: 26, offset: 62715}, + pos: position{line: 1737, col: 26, offset: 64245}, name: "InlineVal", }, }, @@ -12426,29 +12171,29 @@ var g = &grammar{ }, { name: "ImageHeight", - pos: position{line: 1697, col: 1, offset: 62791}, + pos: position{line: 1741, col: 1, offset: 64321}, expr: &actionExpr{ - pos: position{line: 1697, col: 16, offset: 62806}, + pos: position{line: 1741, col: 16, offset: 64336}, run: (*parser).callonImageHeight1, expr: &seqExpr{ - pos: position{line: 1697, col: 16, offset: 62806}, + pos: position{line: 1741, col: 16, offset: 64336}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 1697, col: 16, offset: 62806}, + pos: position{line: 1741, col: 16, offset: 64336}, expr: &litMatcher{ - pos: position{line: 1697, col: 16, offset: 62806}, + pos: position{line: 1741, col: 16, offset: 64336}, val: ",", ignoreCase: false, want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 1697, col: 21, offset: 62811}, + pos: position{line: 1741, col: 21, offset: 64341}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1697, col: 27, offset: 62817}, + pos: position{line: 1741, col: 27, offset: 64347}, expr: &ruleRefExpr{ - pos: position{line: 1697, col: 27, offset: 62817}, + pos: position{line: 1741, col: 27, offset: 64347}, name: "InlineVal", }, }, @@ -12459,32 +12204,32 @@ var g = &grammar{ }, { name: "ImageAltAttr", - pos: position{line: 1701, col: 1, offset: 62899}, + pos: position{line: 1745, col: 1, offset: 64429}, expr: &actionExpr{ - pos: position{line: 1701, col: 17, offset: 62915}, + pos: position{line: 1745, col: 17, offset: 64445}, run: (*parser).callonImageAltAttr1, expr: &seqExpr{ - pos: position{line: 1701, col: 17, offset: 62915}, + pos: position{line: 1745, col: 17, offset: 64445}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 1701, col: 17, offset: 62915}, + pos: position{line: 1745, col: 17, offset: 64445}, expr: &ruleRefExpr{ - pos: position{line: 1701, col: 17, offset: 62915}, + pos: position{line: 1745, col: 17, offset: 64445}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 1701, col: 24, offset: 62922}, + pos: position{line: 1745, col: 24, offset: 64452}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 1701, col: 30, offset: 62928}, + pos: position{line: 1745, col: 30, offset: 64458}, name: "PositionalValue", }, }, &zeroOrMoreExpr{ - pos: position{line: 1701, col: 46, offset: 62944}, + pos: position{line: 1745, col: 46, offset: 64474}, expr: &ruleRefExpr{ - pos: position{line: 1701, col: 46, offset: 62944}, + pos: position{line: 1745, col: 46, offset: 64474}, name: "Space", }, }, @@ -12494,40 +12239,40 @@ var g = &grammar{ }, { name: "ImageWidthAttr", - pos: position{line: 1705, col: 1, offset: 63029}, + pos: position{line: 1749, col: 1, offset: 64550}, expr: &actionExpr{ - pos: position{line: 1705, col: 19, offset: 63047}, + pos: position{line: 1749, col: 19, offset: 64568}, run: (*parser).callonImageWidthAttr1, expr: &seqExpr{ - pos: position{line: 1705, col: 19, offset: 63047}, + pos: position{line: 1749, col: 19, offset: 64568}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 1705, col: 19, offset: 63047}, + pos: position{line: 1749, col: 19, offset: 64568}, expr: &ruleRefExpr{ - pos: position{line: 1705, col: 19, offset: 63047}, + pos: position{line: 1749, col: 19, offset: 64568}, name: "Space", }, }, &litMatcher{ - pos: position{line: 1705, col: 26, offset: 63054}, + pos: position{line: 1749, col: 26, offset: 64575}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 1705, col: 30, offset: 63058}, + pos: position{line: 1749, col: 30, offset: 64579}, expr: &ruleRefExpr{ - pos: position{line: 1705, col: 30, offset: 63058}, + pos: position{line: 1749, col: 30, offset: 64579}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 1705, col: 37, offset: 63065}, + pos: position{line: 1749, col: 37, offset: 64586}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1705, col: 43, offset: 63071}, + pos: position{line: 1749, col: 43, offset: 64592}, expr: &ruleRefExpr{ - pos: position{line: 1705, col: 43, offset: 63071}, + pos: position{line: 1749, col: 43, offset: 64592}, name: "PositionalValue", }, }, @@ -12538,40 +12283,40 @@ var g = &grammar{ }, { name: "ImageHeightAttr", - pos: position{line: 1712, col: 1, offset: 63215}, + pos: position{line: 1756, col: 1, offset: 64727}, expr: &actionExpr{ - pos: position{line: 1712, col: 20, offset: 63234}, + pos: position{line: 1756, col: 20, offset: 64746}, run: (*parser).callonImageHeightAttr1, expr: &seqExpr{ - pos: position{line: 1712, col: 20, offset: 63234}, + pos: position{line: 1756, col: 20, offset: 64746}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 1712, col: 20, offset: 63234}, + pos: position{line: 1756, col: 20, offset: 64746}, expr: &ruleRefExpr{ - pos: position{line: 1712, col: 20, offset: 63234}, + pos: position{line: 1756, col: 20, offset: 64746}, name: "Space", }, }, &litMatcher{ - pos: position{line: 1712, col: 27, offset: 63241}, + pos: position{line: 1756, col: 27, offset: 64753}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 1712, col: 31, offset: 63245}, + pos: position{line: 1756, col: 31, offset: 64757}, expr: &ruleRefExpr{ - pos: position{line: 1712, col: 31, offset: 63245}, + pos: position{line: 1756, col: 31, offset: 64757}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 1712, col: 38, offset: 63252}, + pos: position{line: 1756, col: 38, offset: 64764}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1712, col: 44, offset: 63258}, + pos: position{line: 1756, col: 44, offset: 64770}, expr: &ruleRefExpr{ - pos: position{line: 1712, col: 44, offset: 63258}, + pos: position{line: 1756, col: 44, offset: 64770}, name: "PositionalValue", }, }, @@ -12582,29 +12327,29 @@ var g = &grammar{ }, { name: "InlineIcon", - pos: position{line: 1723, col: 1, offset: 63601}, + pos: position{line: 1767, col: 1, offset: 65104}, expr: &actionExpr{ - pos: position{line: 1723, col: 15, offset: 63615}, + pos: position{line: 1767, col: 15, offset: 65118}, run: (*parser).callonInlineIcon1, expr: &seqExpr{ - pos: position{line: 1723, col: 15, offset: 63615}, + pos: position{line: 1767, col: 15, offset: 65118}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1723, col: 15, offset: 63615}, + pos: position{line: 1767, col: 15, offset: 65118}, val: "icon:", ignoreCase: false, want: "\"icon:\"", }, &labeledExpr{ - pos: position{line: 1723, col: 23, offset: 63623}, + pos: position{line: 1767, col: 23, offset: 65126}, label: "icon", expr: &actionExpr{ - pos: position{line: 1723, col: 29, offset: 63629}, + pos: position{line: 1767, col: 29, offset: 65132}, run: (*parser).callonInlineIcon5, expr: &oneOrMoreExpr{ - pos: position{line: 1723, col: 29, offset: 63629}, + pos: position{line: 1767, col: 29, offset: 65132}, expr: &charClassMatcher{ - pos: position{line: 1723, col: 29, offset: 63629}, + pos: position{line: 1767, col: 29, offset: 65132}, val: "[\\pL0-9_-]", chars: []rune{'_', '-'}, ranges: []rune{'0', '9'}, @@ -12616,10 +12361,10 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1723, col: 73, offset: 63673}, + pos: position{line: 1767, col: 73, offset: 65176}, label: "attrs", expr: &ruleRefExpr{ - pos: position{line: 1723, col: 80, offset: 63680}, + pos: position{line: 1767, col: 80, offset: 65183}, name: "IconAttrs", }, }, @@ -12629,37 +12374,37 @@ var g = &grammar{ }, { name: "IconAttrs", - pos: position{line: 1727, col: 1, offset: 63762}, + pos: position{line: 1771, col: 1, offset: 65265}, expr: &actionExpr{ - pos: position{line: 1727, col: 14, offset: 63775}, + pos: position{line: 1771, col: 14, offset: 65278}, run: (*parser).callonIconAttrs1, expr: &seqExpr{ - pos: position{line: 1727, col: 14, offset: 63775}, + pos: position{line: 1771, col: 14, offset: 65278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1727, col: 14, offset: 63775}, + pos: position{line: 1771, col: 14, offset: 65278}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1727, col: 18, offset: 63779}, + pos: position{line: 1771, col: 18, offset: 65282}, label: "size", expr: &ruleRefExpr{ - pos: position{line: 1727, col: 23, offset: 63784}, + pos: position{line: 1771, col: 23, offset: 65287}, name: "IconSize", }, }, &labeledExpr{ - pos: position{line: 1727, col: 32, offset: 63793}, + pos: position{line: 1771, col: 32, offset: 65296}, label: "nv", expr: &ruleRefExpr{ - pos: position{line: 1727, col: 35, offset: 63796}, + pos: position{line: 1771, col: 35, offset: 65299}, name: "NamedAttrs", }, }, &litMatcher{ - pos: position{line: 1727, col: 46, offset: 63807}, + pos: position{line: 1771, col: 46, offset: 65310}, val: "]", ignoreCase: false, want: "\"]\"", @@ -12670,17 +12415,17 @@ var g = &grammar{ }, { name: "IconSize", - pos: position{line: 1731, col: 1, offset: 63864}, + pos: position{line: 1775, col: 1, offset: 65367}, expr: &actionExpr{ - pos: position{line: 1731, col: 13, offset: 63876}, + pos: position{line: 1775, col: 13, offset: 65379}, run: (*parser).callonIconSize1, expr: &labeledExpr{ - pos: position{line: 1731, col: 13, offset: 63876}, + pos: position{line: 1775, col: 13, offset: 65379}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 1731, col: 19, offset: 63882}, + pos: position{line: 1775, col: 19, offset: 65385}, expr: &ruleRefExpr{ - pos: position{line: 1731, col: 19, offset: 63882}, + pos: position{line: 1775, col: 19, offset: 65385}, name: "InlineVal", }, }, @@ -12689,32 +12434,32 @@ var g = &grammar{ }, { name: "InlineFootnote", - pos: position{line: 1738, col: 1, offset: 64158}, + pos: position{line: 1782, col: 1, offset: 65661}, expr: &choiceExpr{ - pos: position{line: 1738, col: 19, offset: 64176}, + pos: position{line: 1782, col: 19, offset: 65679}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1738, col: 19, offset: 64176}, + pos: position{line: 1782, col: 19, offset: 65679}, run: (*parser).callonInlineFootnote2, expr: &seqExpr{ - pos: position{line: 1738, col: 19, offset: 64176}, + pos: position{line: 1782, col: 19, offset: 65679}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1738, col: 19, offset: 64176}, + pos: position{line: 1782, col: 19, offset: 65679}, val: "footnote:[", ignoreCase: false, want: "\"footnote:[\"", }, &labeledExpr{ - pos: position{line: 1738, col: 32, offset: 64189}, + pos: position{line: 1782, col: 32, offset: 65692}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1738, col: 41, offset: 64198}, + pos: position{line: 1782, col: 41, offset: 65701}, name: "FootnoteContent", }, }, &litMatcher{ - pos: position{line: 1738, col: 58, offset: 64215}, + pos: position{line: 1782, col: 58, offset: 65718}, val: "]", ignoreCase: false, want: "\"]\"", @@ -12723,44 +12468,44 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1740, col: 5, offset: 64283}, + pos: position{line: 1784, col: 5, offset: 65786}, run: (*parser).callonInlineFootnote8, expr: &seqExpr{ - pos: position{line: 1740, col: 5, offset: 64283}, + pos: position{line: 1784, col: 5, offset: 65786}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1740, col: 5, offset: 64283}, + pos: position{line: 1784, col: 5, offset: 65786}, val: "footnote:", ignoreCase: false, want: "\"footnote:\"", }, &labeledExpr{ - pos: position{line: 1740, col: 17, offset: 64295}, + pos: position{line: 1784, col: 17, offset: 65798}, label: "ref", expr: &ruleRefExpr{ - pos: position{line: 1740, col: 22, offset: 64300}, + pos: position{line: 1784, col: 22, offset: 65803}, name: "FootnoteRef", }, }, &litMatcher{ - pos: position{line: 1740, col: 35, offset: 64313}, + pos: position{line: 1784, col: 35, offset: 65816}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1740, col: 39, offset: 64317}, + pos: position{line: 1784, col: 39, offset: 65820}, label: "content", expr: &zeroOrOneExpr{ - pos: position{line: 1740, col: 47, offset: 64325}, + pos: position{line: 1784, col: 47, offset: 65828}, expr: &ruleRefExpr{ - pos: position{line: 1740, col: 48, offset: 64326}, + pos: position{line: 1784, col: 48, offset: 65829}, name: "FootnoteContent", }, }, }, &litMatcher{ - pos: position{line: 1740, col: 66, offset: 64344}, + pos: position{line: 1784, col: 66, offset: 65847}, val: "]", ignoreCase: false, want: "\"]\"", @@ -12773,37 +12518,37 @@ var g = &grammar{ }, { name: "FootnoteRef", - pos: position{line: 1744, col: 1, offset: 64405}, + pos: position{line: 1788, col: 1, offset: 65908}, expr: &ruleRefExpr{ - pos: position{line: 1744, col: 16, offset: 64420}, + pos: position{line: 1788, col: 16, offset: 65923}, name: "Alphanums", }, }, { name: "FootnoteContent", - pos: position{line: 1746, col: 1, offset: 64431}, + pos: position{line: 1790, col: 1, offset: 65934}, expr: &actionExpr{ - pos: position{line: 1746, col: 20, offset: 64450}, + pos: position{line: 1790, col: 20, offset: 65953}, run: (*parser).callonFootnoteContent1, expr: &labeledExpr{ - pos: position{line: 1746, col: 20, offset: 64450}, + pos: position{line: 1790, col: 20, offset: 65953}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1746, col: 29, offset: 64459}, + pos: position{line: 1790, col: 29, offset: 65962}, expr: &seqExpr{ - pos: position{line: 1746, col: 30, offset: 64460}, + pos: position{line: 1790, col: 30, offset: 65963}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1746, col: 30, offset: 64460}, + pos: position{line: 1790, col: 30, offset: 65963}, expr: &litMatcher{ - pos: position{line: 1746, col: 31, offset: 64461}, + pos: position{line: 1790, col: 31, offset: 65964}, val: "]", ignoreCase: false, want: "\"]\"", }, }, &ruleRefExpr{ - pos: position{line: 1746, col: 35, offset: 64465}, + pos: position{line: 1790, col: 35, offset: 65968}, name: "InlineElement", }, }, @@ -12814,60 +12559,60 @@ var g = &grammar{ }, { name: "DelimitedBlock", - pos: position{line: 1753, col: 1, offset: 64789}, + pos: position{line: 1797, col: 1, offset: 66292}, expr: &actionExpr{ - pos: position{line: 1753, col: 19, offset: 64807}, + pos: position{line: 1797, col: 19, offset: 66310}, run: (*parser).callonDelimitedBlock1, expr: &seqExpr{ - pos: position{line: 1753, col: 19, offset: 64807}, + pos: position{line: 1797, col: 19, offset: 66310}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1753, col: 19, offset: 64807}, + pos: position{line: 1797, col: 19, offset: 66310}, expr: &ruleRefExpr{ - pos: position{line: 1753, col: 20, offset: 64808}, + pos: position{line: 1797, col: 20, offset: 66311}, name: "Alphanum", }, }, &labeledExpr{ - pos: position{line: 1754, col: 5, offset: 64896}, + pos: position{line: 1798, col: 5, offset: 66399}, label: "block", expr: &choiceExpr{ - pos: position{line: 1754, col: 12, offset: 64903}, + pos: position{line: 1798, col: 12, offset: 66406}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1754, col: 12, offset: 64903}, + pos: position{line: 1798, col: 12, offset: 66406}, name: "FencedBlock", }, &ruleRefExpr{ - pos: position{line: 1755, col: 11, offset: 64926}, + pos: position{line: 1799, col: 11, offset: 66429}, name: "ListingBlock", }, &ruleRefExpr{ - pos: position{line: 1756, col: 11, offset: 64950}, + pos: position{line: 1800, col: 11, offset: 66453}, name: "ExampleBlock", }, &ruleRefExpr{ - pos: position{line: 1757, col: 11, offset: 64974}, + pos: position{line: 1801, col: 11, offset: 66477}, name: "QuoteBlock", }, &ruleRefExpr{ - pos: position{line: 1758, col: 11, offset: 64995}, + pos: position{line: 1802, col: 11, offset: 66498}, name: "SidebarBlock", }, &ruleRefExpr{ - pos: position{line: 1759, col: 11, offset: 65018}, + pos: position{line: 1803, col: 11, offset: 66521}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 1760, col: 11, offset: 65046}, + pos: position{line: 1804, col: 11, offset: 66549}, name: "PassthroughBlock", }, &ruleRefExpr{ - pos: position{line: 1761, col: 11, offset: 65073}, + pos: position{line: 1805, col: 11, offset: 66576}, name: "Table", }, &ruleRefExpr{ - pos: position{line: 1762, col: 11, offset: 65089}, + pos: position{line: 1806, col: 11, offset: 66592}, name: "CommentBlock", }, }, @@ -12879,52 +12624,52 @@ var g = &grammar{ }, { name: "BlockDelimiter", - pos: position{line: 1766, col: 1, offset: 65130}, + pos: position{line: 1810, col: 1, offset: 66633}, expr: &choiceExpr{ - pos: position{line: 1766, col: 19, offset: 65148}, + pos: position{line: 1810, col: 19, offset: 66651}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1766, col: 19, offset: 65148}, + pos: position{line: 1810, col: 19, offset: 66651}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1766, col: 19, offset: 65148}, + pos: position{line: 1810, col: 19, offset: 66651}, expr: &ruleRefExpr{ - pos: position{line: 1766, col: 21, offset: 65150}, + pos: position{line: 1810, col: 21, offset: 66653}, name: "Alphanum", }, }, &ruleRefExpr{ - pos: position{line: 1766, col: 31, offset: 65160}, + pos: position{line: 1810, col: 31, offset: 66663}, name: "LiteralBlockDelimiter", }, }, }, &ruleRefExpr{ - pos: position{line: 1767, col: 19, offset: 65231}, + pos: position{line: 1811, col: 19, offset: 66734}, name: "FencedBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1768, col: 19, offset: 65271}, + pos: position{line: 1812, col: 19, offset: 66774}, name: "ListingBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1769, col: 19, offset: 65312}, + pos: position{line: 1813, col: 19, offset: 66815}, name: "ExampleBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1770, col: 19, offset: 65353}, + pos: position{line: 1814, col: 19, offset: 66856}, name: "CommentBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1771, col: 19, offset: 65394}, + pos: position{line: 1815, col: 19, offset: 66897}, name: "QuoteBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1772, col: 19, offset: 65432}, + pos: position{line: 1816, col: 19, offset: 66935}, name: "SidebarBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1773, col: 19, offset: 65472}, + pos: position{line: 1817, col: 19, offset: 66975}, name: "PassthroughBlockDelimiter", }, }, @@ -12932,16 +12677,16 @@ var g = &grammar{ }, { name: "DelimitedBlockRawLine", - pos: position{line: 1775, col: 1, offset: 65499}, + pos: position{line: 1819, col: 1, offset: 67002}, expr: &choiceExpr{ - pos: position{line: 1775, col: 26, offset: 65524}, + pos: position{line: 1819, col: 26, offset: 67027}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1775, col: 26, offset: 65524}, + pos: position{line: 1819, col: 26, offset: 67027}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 1775, col: 42, offset: 65540}, + pos: position{line: 1819, col: 42, offset: 67043}, name: "RawLine", }, }, @@ -12949,30 +12694,30 @@ var g = &grammar{ }, { name: "RawLine", - pos: position{line: 1777, col: 1, offset: 65549}, + pos: position{line: 1821, col: 1, offset: 67052}, expr: &actionExpr{ - pos: position{line: 1777, col: 12, offset: 65560}, + pos: position{line: 1821, col: 12, offset: 67063}, run: (*parser).callonRawLine1, expr: &seqExpr{ - pos: position{line: 1777, col: 12, offset: 65560}, + pos: position{line: 1821, col: 12, offset: 67063}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1777, col: 12, offset: 65560}, + pos: position{line: 1821, col: 12, offset: 67063}, expr: &ruleRefExpr{ - pos: position{line: 1777, col: 13, offset: 65561}, + pos: position{line: 1821, col: 13, offset: 67064}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 1777, col: 17, offset: 65565}, + pos: position{line: 1821, col: 17, offset: 67068}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1777, col: 26, offset: 65574}, + pos: position{line: 1821, col: 26, offset: 67077}, name: "RawLineContent", }, }, &ruleRefExpr{ - pos: position{line: 1777, col: 42, offset: 65590}, + pos: position{line: 1821, col: 42, offset: 67093}, name: "EOL", }, }, @@ -12981,14 +12726,14 @@ var g = &grammar{ }, { name: "RawLineContent", - pos: position{line: 1781, col: 1, offset: 65670}, + pos: position{line: 1825, col: 1, offset: 67173}, expr: &actionExpr{ - pos: position{line: 1781, col: 19, offset: 65688}, + pos: position{line: 1825, col: 19, offset: 67191}, run: (*parser).callonRawLineContent1, expr: &zeroOrMoreExpr{ - pos: position{line: 1781, col: 19, offset: 65688}, + pos: position{line: 1825, col: 19, offset: 67191}, expr: &charClassMatcher{ - pos: position{line: 1781, col: 19, offset: 65688}, + pos: position{line: 1825, col: 19, offset: 67191}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -12999,28 +12744,28 @@ var g = &grammar{ }, { name: "CalloutListItem", - pos: position{line: 1785, col: 1, offset: 65735}, + pos: position{line: 1829, col: 1, offset: 67238}, expr: &actionExpr{ - pos: position{line: 1785, col: 20, offset: 65754}, + pos: position{line: 1829, col: 20, offset: 67257}, run: (*parser).callonCalloutListItem1, expr: &seqExpr{ - pos: position{line: 1785, col: 20, offset: 65754}, + pos: position{line: 1829, col: 20, offset: 67257}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1785, col: 20, offset: 65754}, + pos: position{line: 1829, col: 20, offset: 67257}, label: "ref", expr: &ruleRefExpr{ - pos: position{line: 1785, col: 25, offset: 65759}, + pos: position{line: 1829, col: 25, offset: 67262}, name: "CalloutListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 1785, col: 48, offset: 65782}, + pos: position{line: 1829, col: 48, offset: 67285}, label: "description", expr: &oneOrMoreExpr{ - pos: position{line: 1785, col: 61, offset: 65795}, + pos: position{line: 1829, col: 61, offset: 67298}, expr: &ruleRefExpr{ - pos: position{line: 1785, col: 61, offset: 65795}, + pos: position{line: 1829, col: 61, offset: 67298}, name: "ListParagraph", }, }, @@ -13031,29 +12776,29 @@ var g = &grammar{ }, { name: "CalloutListItemPrefix", - pos: position{line: 1789, col: 1, offset: 65892}, + pos: position{line: 1833, col: 1, offset: 67395}, expr: &actionExpr{ - pos: position{line: 1789, col: 26, offset: 65917}, + pos: position{line: 1833, col: 26, offset: 67420}, run: (*parser).callonCalloutListItemPrefix1, expr: &seqExpr{ - pos: position{line: 1789, col: 26, offset: 65917}, + pos: position{line: 1833, col: 26, offset: 67420}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1789, col: 26, offset: 65917}, + pos: position{line: 1833, col: 26, offset: 67420}, val: "<", ignoreCase: false, want: "\"<\"", }, &labeledExpr{ - pos: position{line: 1789, col: 30, offset: 65921}, + pos: position{line: 1833, col: 30, offset: 67424}, label: "ref", expr: &actionExpr{ - pos: position{line: 1789, col: 35, offset: 65926}, + pos: position{line: 1833, col: 35, offset: 67429}, run: (*parser).callonCalloutListItemPrefix5, expr: &oneOrMoreExpr{ - pos: position{line: 1789, col: 35, offset: 65926}, + pos: position{line: 1833, col: 35, offset: 67429}, expr: &charClassMatcher{ - pos: position{line: 1789, col: 35, offset: 65926}, + pos: position{line: 1833, col: 35, offset: 67429}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -13063,15 +12808,15 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1789, col: 83, offset: 65974}, + pos: position{line: 1833, col: 83, offset: 67477}, val: ">", ignoreCase: false, want: "\">\"", }, &oneOrMoreExpr{ - pos: position{line: 1789, col: 87, offset: 65978}, + pos: position{line: 1833, col: 87, offset: 67481}, expr: &ruleRefExpr{ - pos: position{line: 1789, col: 87, offset: 65978}, + pos: position{line: 1833, col: 87, offset: 67481}, name: "Space", }, }, @@ -13081,25 +12826,25 @@ var g = &grammar{ }, { name: "FencedBlockDelimiter", - pos: position{line: 1796, col: 1, offset: 66205}, + pos: position{line: 1840, col: 1, offset: 67708}, expr: &seqExpr{ - pos: position{line: 1796, col: 25, offset: 66229}, + pos: position{line: 1840, col: 25, offset: 67732}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1796, col: 25, offset: 66229}, + pos: position{line: 1840, col: 25, offset: 67732}, val: "```", ignoreCase: false, want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1796, col: 31, offset: 66235}, + pos: position{line: 1840, col: 31, offset: 67738}, expr: &ruleRefExpr{ - pos: position{line: 1796, col: 31, offset: 66235}, + pos: position{line: 1840, col: 31, offset: 67738}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1796, col: 38, offset: 66242}, + pos: position{line: 1840, col: 38, offset: 67745}, name: "EOL", }, }, @@ -13107,25 +12852,25 @@ var g = &grammar{ }, { name: "FencedBlockStartDelimiter", - pos: position{line: 1798, col: 1, offset: 66302}, + pos: position{line: 1842, col: 1, offset: 67805}, expr: &seqExpr{ - pos: position{line: 1798, col: 30, offset: 66331}, + pos: position{line: 1842, col: 30, offset: 67834}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1798, col: 30, offset: 66331}, + pos: position{line: 1842, col: 30, offset: 67834}, val: "```", ignoreCase: false, want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1798, col: 36, offset: 66337}, + pos: position{line: 1842, col: 36, offset: 67840}, expr: &ruleRefExpr{ - pos: position{line: 1798, col: 36, offset: 66337}, + pos: position{line: 1842, col: 36, offset: 67840}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1798, col: 43, offset: 66344}, + pos: position{line: 1842, col: 43, offset: 67847}, name: "EOL", }, }, @@ -13133,34 +12878,34 @@ var g = &grammar{ }, { name: "FencedBlockEndDelimiter", - pos: position{line: 1800, col: 1, offset: 66349}, + pos: position{line: 1844, col: 1, offset: 67852}, expr: &choiceExpr{ - pos: position{line: 1800, col: 28, offset: 66376}, + pos: position{line: 1844, col: 28, offset: 67879}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1800, col: 29, offset: 66377}, + pos: position{line: 1844, col: 29, offset: 67880}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1800, col: 29, offset: 66377}, + pos: position{line: 1844, col: 29, offset: 67880}, val: "```", ignoreCase: false, want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1800, col: 35, offset: 66383}, + pos: position{line: 1844, col: 35, offset: 67886}, expr: &ruleRefExpr{ - pos: position{line: 1800, col: 35, offset: 66383}, + pos: position{line: 1844, col: 35, offset: 67886}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1800, col: 42, offset: 66390}, + pos: position{line: 1844, col: 42, offset: 67893}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1800, col: 49, offset: 66397}, + pos: position{line: 1844, col: 49, offset: 67900}, name: "EOF", }, }, @@ -13168,38 +12913,38 @@ var g = &grammar{ }, { name: "FencedBlock", - pos: position{line: 1802, col: 1, offset: 66402}, + pos: position{line: 1846, col: 1, offset: 67905}, expr: &actionExpr{ - pos: position{line: 1802, col: 16, offset: 66417}, + pos: position{line: 1846, col: 16, offset: 67920}, run: (*parser).callonFencedBlock1, expr: &seqExpr{ - pos: position{line: 1802, col: 16, offset: 66417}, + pos: position{line: 1846, col: 16, offset: 67920}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1802, col: 16, offset: 66417}, + pos: position{line: 1846, col: 16, offset: 67920}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1802, col: 27, offset: 66428}, + pos: position{line: 1846, col: 27, offset: 67931}, expr: &ruleRefExpr{ - pos: position{line: 1802, col: 28, offset: 66429}, + pos: position{line: 1846, col: 28, offset: 67932}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1802, col: 41, offset: 66442}, + pos: position{line: 1846, col: 41, offset: 67945}, name: "FencedBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1802, col: 67, offset: 66468}, + pos: position{line: 1846, col: 67, offset: 67971}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1802, col: 76, offset: 66477}, + pos: position{line: 1846, col: 76, offset: 67980}, name: "FencedBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 1802, col: 99, offset: 66500}, + pos: position{line: 1846, col: 99, offset: 68003}, name: "FencedBlockEndDelimiter", }, }, @@ -13208,27 +12953,27 @@ var g = &grammar{ }, { name: "FencedBlockRawContent", - pos: position{line: 1806, col: 1, offset: 66615}, + pos: position{line: 1850, col: 1, offset: 68118}, expr: &zeroOrMoreExpr{ - pos: position{line: 1806, col: 26, offset: 66640}, + pos: position{line: 1850, col: 26, offset: 68143}, expr: &actionExpr{ - pos: position{line: 1806, col: 27, offset: 66641}, + pos: position{line: 1850, col: 27, offset: 68144}, run: (*parser).callonFencedBlockRawContent2, expr: &seqExpr{ - pos: position{line: 1806, col: 27, offset: 66641}, + pos: position{line: 1850, col: 27, offset: 68144}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1806, col: 27, offset: 66641}, + pos: position{line: 1850, col: 27, offset: 68144}, expr: &ruleRefExpr{ - pos: position{line: 1806, col: 28, offset: 66642}, + pos: position{line: 1850, col: 28, offset: 68145}, name: "FencedBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1806, col: 52, offset: 66666}, + pos: position{line: 1850, col: 52, offset: 68169}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1806, col: 58, offset: 66672}, + pos: position{line: 1850, col: 58, offset: 68175}, name: "DelimitedBlockRawLine", }, }, @@ -13239,25 +12984,25 @@ var g = &grammar{ }, { name: "ListingBlockDelimiter", - pos: position{line: 1813, col: 1, offset: 67012}, + pos: position{line: 1857, col: 1, offset: 68515}, expr: &seqExpr{ - pos: position{line: 1813, col: 26, offset: 67037}, + pos: position{line: 1857, col: 26, offset: 68540}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1813, col: 26, offset: 67037}, + pos: position{line: 1857, col: 26, offset: 68540}, val: "----", ignoreCase: false, want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1813, col: 33, offset: 67044}, + pos: position{line: 1857, col: 33, offset: 68547}, expr: &ruleRefExpr{ - pos: position{line: 1813, col: 33, offset: 67044}, + pos: position{line: 1857, col: 33, offset: 68547}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1813, col: 40, offset: 67051}, + pos: position{line: 1857, col: 40, offset: 68554}, name: "EOL", }, }, @@ -13265,25 +13010,25 @@ var g = &grammar{ }, { name: "ListingBlockStartDelimiter", - pos: position{line: 1815, col: 1, offset: 67056}, + pos: position{line: 1859, col: 1, offset: 68559}, expr: &seqExpr{ - pos: position{line: 1815, col: 31, offset: 67086}, + pos: position{line: 1859, col: 31, offset: 68589}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1815, col: 31, offset: 67086}, + pos: position{line: 1859, col: 31, offset: 68589}, val: "----", ignoreCase: false, want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1815, col: 38, offset: 67093}, + pos: position{line: 1859, col: 38, offset: 68596}, expr: &ruleRefExpr{ - pos: position{line: 1815, col: 38, offset: 67093}, + pos: position{line: 1859, col: 38, offset: 68596}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1815, col: 45, offset: 67100}, + pos: position{line: 1859, col: 45, offset: 68603}, name: "EOL", }, }, @@ -13291,34 +13036,34 @@ var g = &grammar{ }, { name: "ListingBlockEndDelimiter", - pos: position{line: 1817, col: 1, offset: 67105}, + pos: position{line: 1861, col: 1, offset: 68608}, expr: &choiceExpr{ - pos: position{line: 1817, col: 29, offset: 67133}, + pos: position{line: 1861, col: 29, offset: 68636}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1817, col: 30, offset: 67134}, + pos: position{line: 1861, col: 30, offset: 68637}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1817, col: 30, offset: 67134}, + pos: position{line: 1861, col: 30, offset: 68637}, val: "----", ignoreCase: false, want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1817, col: 37, offset: 67141}, + pos: position{line: 1861, col: 37, offset: 68644}, expr: &ruleRefExpr{ - pos: position{line: 1817, col: 37, offset: 67141}, + pos: position{line: 1861, col: 37, offset: 68644}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1817, col: 44, offset: 67148}, + pos: position{line: 1861, col: 44, offset: 68651}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1817, col: 51, offset: 67155}, + pos: position{line: 1861, col: 51, offset: 68658}, name: "EOF", }, }, @@ -13326,38 +13071,38 @@ var g = &grammar{ }, { name: "ListingBlock", - pos: position{line: 1819, col: 1, offset: 67160}, + pos: position{line: 1863, col: 1, offset: 68663}, expr: &actionExpr{ - pos: position{line: 1819, col: 17, offset: 67176}, + pos: position{line: 1863, col: 17, offset: 68679}, run: (*parser).callonListingBlock1, expr: &seqExpr{ - pos: position{line: 1819, col: 17, offset: 67176}, + pos: position{line: 1863, col: 17, offset: 68679}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1819, col: 17, offset: 67176}, + pos: position{line: 1863, col: 17, offset: 68679}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1819, col: 28, offset: 67187}, + pos: position{line: 1863, col: 28, offset: 68690}, expr: &ruleRefExpr{ - pos: position{line: 1819, col: 29, offset: 67188}, + pos: position{line: 1863, col: 29, offset: 68691}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1819, col: 42, offset: 67201}, + pos: position{line: 1863, col: 42, offset: 68704}, name: "ListingBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1819, col: 69, offset: 67228}, + pos: position{line: 1863, col: 69, offset: 68731}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1819, col: 78, offset: 67237}, + pos: position{line: 1863, col: 78, offset: 68740}, name: "ListingBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 1819, col: 102, offset: 67261}, + pos: position{line: 1863, col: 102, offset: 68764}, name: "ListingBlockEndDelimiter", }, }, @@ -13366,27 +13111,27 @@ var g = &grammar{ }, { name: "ListingBlockRawContent", - pos: position{line: 1823, col: 1, offset: 67378}, + pos: position{line: 1867, col: 1, offset: 68881}, expr: &zeroOrMoreExpr{ - pos: position{line: 1823, col: 27, offset: 67404}, + pos: position{line: 1867, col: 27, offset: 68907}, expr: &actionExpr{ - pos: position{line: 1823, col: 28, offset: 67405}, + pos: position{line: 1867, col: 28, offset: 68908}, run: (*parser).callonListingBlockRawContent2, expr: &seqExpr{ - pos: position{line: 1823, col: 28, offset: 67405}, + pos: position{line: 1867, col: 28, offset: 68908}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1823, col: 28, offset: 67405}, + pos: position{line: 1867, col: 28, offset: 68908}, expr: &ruleRefExpr{ - pos: position{line: 1823, col: 29, offset: 67406}, + pos: position{line: 1867, col: 29, offset: 68909}, name: "ListingBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1823, col: 54, offset: 67431}, + pos: position{line: 1867, col: 54, offset: 68934}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1823, col: 60, offset: 67437}, + pos: position{line: 1867, col: 60, offset: 68940}, name: "DelimitedBlockRawLine", }, }, @@ -13397,25 +13142,25 @@ var g = &grammar{ }, { name: "ExampleBlockDelimiter", - pos: position{line: 1830, col: 1, offset: 67777}, + pos: position{line: 1874, col: 1, offset: 69280}, expr: &seqExpr{ - pos: position{line: 1830, col: 26, offset: 67802}, + pos: position{line: 1874, col: 26, offset: 69305}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1830, col: 26, offset: 67802}, + pos: position{line: 1874, col: 26, offset: 69305}, val: "====", ignoreCase: false, want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1830, col: 33, offset: 67809}, + pos: position{line: 1874, col: 33, offset: 69312}, expr: &ruleRefExpr{ - pos: position{line: 1830, col: 33, offset: 67809}, + pos: position{line: 1874, col: 33, offset: 69312}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1830, col: 40, offset: 67816}, + pos: position{line: 1874, col: 40, offset: 69319}, name: "EOL", }, }, @@ -13423,25 +13168,25 @@ var g = &grammar{ }, { name: "ExampleBlockStartDelimiter", - pos: position{line: 1832, col: 1, offset: 67821}, + pos: position{line: 1876, col: 1, offset: 69324}, expr: &seqExpr{ - pos: position{line: 1832, col: 31, offset: 67851}, + pos: position{line: 1876, col: 31, offset: 69354}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1832, col: 31, offset: 67851}, + pos: position{line: 1876, col: 31, offset: 69354}, val: "====", ignoreCase: false, want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1832, col: 38, offset: 67858}, + pos: position{line: 1876, col: 38, offset: 69361}, expr: &ruleRefExpr{ - pos: position{line: 1832, col: 38, offset: 67858}, + pos: position{line: 1876, col: 38, offset: 69361}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1832, col: 45, offset: 67865}, + pos: position{line: 1876, col: 45, offset: 69368}, name: "EOL", }, }, @@ -13449,34 +13194,34 @@ var g = &grammar{ }, { name: "ExampleBlockEndDelimiter", - pos: position{line: 1834, col: 1, offset: 67870}, + pos: position{line: 1878, col: 1, offset: 69373}, expr: &choiceExpr{ - pos: position{line: 1834, col: 29, offset: 67898}, + pos: position{line: 1878, col: 29, offset: 69401}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1834, col: 30, offset: 67899}, + pos: position{line: 1878, col: 30, offset: 69402}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1834, col: 30, offset: 67899}, + pos: position{line: 1878, col: 30, offset: 69402}, val: "====", ignoreCase: false, want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1834, col: 37, offset: 67906}, + pos: position{line: 1878, col: 37, offset: 69409}, expr: &ruleRefExpr{ - pos: position{line: 1834, col: 37, offset: 67906}, + pos: position{line: 1878, col: 37, offset: 69409}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1834, col: 44, offset: 67913}, + pos: position{line: 1878, col: 44, offset: 69416}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1834, col: 51, offset: 67920}, + pos: position{line: 1878, col: 51, offset: 69423}, name: "EOF", }, }, @@ -13484,38 +13229,38 @@ var g = &grammar{ }, { name: "ExampleBlock", - pos: position{line: 1836, col: 1, offset: 67925}, + pos: position{line: 1880, col: 1, offset: 69428}, expr: &actionExpr{ - pos: position{line: 1836, col: 17, offset: 67941}, + pos: position{line: 1880, col: 17, offset: 69444}, run: (*parser).callonExampleBlock1, expr: &seqExpr{ - pos: position{line: 1836, col: 17, offset: 67941}, + pos: position{line: 1880, col: 17, offset: 69444}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1836, col: 17, offset: 67941}, + pos: position{line: 1880, col: 17, offset: 69444}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1836, col: 28, offset: 67952}, + pos: position{line: 1880, col: 28, offset: 69455}, expr: &ruleRefExpr{ - pos: position{line: 1836, col: 29, offset: 67953}, + pos: position{line: 1880, col: 29, offset: 69456}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1836, col: 42, offset: 67966}, + pos: position{line: 1880, col: 42, offset: 69469}, name: "ExampleBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1836, col: 69, offset: 67993}, + pos: position{line: 1880, col: 69, offset: 69496}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1836, col: 78, offset: 68002}, + pos: position{line: 1880, col: 78, offset: 69505}, name: "ExampleBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 1836, col: 102, offset: 68026}, + pos: position{line: 1880, col: 102, offset: 69529}, name: "ExampleBlockEndDelimiter", }, }, @@ -13524,27 +13269,27 @@ var g = &grammar{ }, { name: "ExampleBlockRawContent", - pos: position{line: 1840, col: 1, offset: 68143}, + pos: position{line: 1884, col: 1, offset: 69646}, expr: &zeroOrMoreExpr{ - pos: position{line: 1840, col: 27, offset: 68169}, + pos: position{line: 1884, col: 27, offset: 69672}, expr: &actionExpr{ - pos: position{line: 1840, col: 28, offset: 68170}, + pos: position{line: 1884, col: 28, offset: 69673}, run: (*parser).callonExampleBlockRawContent2, expr: &seqExpr{ - pos: position{line: 1840, col: 28, offset: 68170}, + pos: position{line: 1884, col: 28, offset: 69673}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1840, col: 28, offset: 68170}, + pos: position{line: 1884, col: 28, offset: 69673}, expr: &ruleRefExpr{ - pos: position{line: 1840, col: 29, offset: 68171}, + pos: position{line: 1884, col: 29, offset: 69674}, name: "ExampleBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1840, col: 54, offset: 68196}, + pos: position{line: 1884, col: 54, offset: 69699}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1840, col: 60, offset: 68202}, + pos: position{line: 1884, col: 60, offset: 69705}, name: "DelimitedBlockRawLine", }, }, @@ -13555,25 +13300,25 @@ var g = &grammar{ }, { name: "QuoteBlockDelimiter", - pos: position{line: 1847, col: 1, offset: 68540}, + pos: position{line: 1891, col: 1, offset: 70043}, expr: &seqExpr{ - pos: position{line: 1847, col: 24, offset: 68563}, + pos: position{line: 1891, col: 24, offset: 70066}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1847, col: 24, offset: 68563}, + pos: position{line: 1891, col: 24, offset: 70066}, val: "____", ignoreCase: false, want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1847, col: 31, offset: 68570}, + pos: position{line: 1891, col: 31, offset: 70073}, expr: &ruleRefExpr{ - pos: position{line: 1847, col: 31, offset: 68570}, + pos: position{line: 1891, col: 31, offset: 70073}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1847, col: 38, offset: 68577}, + pos: position{line: 1891, col: 38, offset: 70080}, name: "EOL", }, }, @@ -13581,25 +13326,25 @@ var g = &grammar{ }, { name: "QuoteBlockStartDelimiter", - pos: position{line: 1849, col: 1, offset: 68607}, + pos: position{line: 1893, col: 1, offset: 70110}, expr: &seqExpr{ - pos: position{line: 1849, col: 29, offset: 68635}, + pos: position{line: 1893, col: 29, offset: 70138}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1849, col: 29, offset: 68635}, + pos: position{line: 1893, col: 29, offset: 70138}, val: "____", ignoreCase: false, want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1849, col: 36, offset: 68642}, + pos: position{line: 1893, col: 36, offset: 70145}, expr: &ruleRefExpr{ - pos: position{line: 1849, col: 36, offset: 68642}, + pos: position{line: 1893, col: 36, offset: 70145}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1849, col: 43, offset: 68649}, + pos: position{line: 1893, col: 43, offset: 70152}, name: "EOL", }, }, @@ -13607,34 +13352,34 @@ var g = &grammar{ }, { name: "QuoteBlockEndDelimiter", - pos: position{line: 1851, col: 1, offset: 68679}, + pos: position{line: 1895, col: 1, offset: 70182}, expr: &choiceExpr{ - pos: position{line: 1851, col: 27, offset: 68705}, + pos: position{line: 1895, col: 27, offset: 70208}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1851, col: 28, offset: 68706}, + pos: position{line: 1895, col: 28, offset: 70209}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1851, col: 28, offset: 68706}, + pos: position{line: 1895, col: 28, offset: 70209}, val: "____", ignoreCase: false, want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1851, col: 35, offset: 68713}, + pos: position{line: 1895, col: 35, offset: 70216}, expr: &ruleRefExpr{ - pos: position{line: 1851, col: 35, offset: 68713}, + pos: position{line: 1895, col: 35, offset: 70216}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1851, col: 42, offset: 68720}, + pos: position{line: 1895, col: 42, offset: 70223}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1851, col: 49, offset: 68727}, + pos: position{line: 1895, col: 49, offset: 70230}, name: "EOF", }, }, @@ -13642,38 +13387,38 @@ var g = &grammar{ }, { name: "QuoteBlock", - pos: position{line: 1853, col: 1, offset: 68757}, + pos: position{line: 1897, col: 1, offset: 70260}, expr: &actionExpr{ - pos: position{line: 1853, col: 15, offset: 68771}, + pos: position{line: 1897, col: 15, offset: 70274}, run: (*parser).callonQuoteBlock1, expr: &seqExpr{ - pos: position{line: 1853, col: 15, offset: 68771}, + pos: position{line: 1897, col: 15, offset: 70274}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1853, col: 15, offset: 68771}, + pos: position{line: 1897, col: 15, offset: 70274}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1853, col: 26, offset: 68782}, + pos: position{line: 1897, col: 26, offset: 70285}, expr: &ruleRefExpr{ - pos: position{line: 1853, col: 27, offset: 68783}, + pos: position{line: 1897, col: 27, offset: 70286}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1853, col: 40, offset: 68796}, + pos: position{line: 1897, col: 40, offset: 70299}, name: "QuoteBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1853, col: 65, offset: 68821}, + pos: position{line: 1897, col: 65, offset: 70324}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1853, col: 74, offset: 68830}, + pos: position{line: 1897, col: 74, offset: 70333}, name: "QuoteBlockVerbatimElement", }, }, &ruleRefExpr{ - pos: position{line: 1853, col: 101, offset: 68857}, + pos: position{line: 1897, col: 101, offset: 70360}, name: "QuoteBlockEndDelimiter", }, }, @@ -13682,27 +13427,27 @@ var g = &grammar{ }, { name: "QuoteBlockVerbatimElement", - pos: position{line: 1857, col: 1, offset: 68970}, + pos: position{line: 1901, col: 1, offset: 70473}, expr: &zeroOrMoreExpr{ - pos: position{line: 1857, col: 30, offset: 68999}, + pos: position{line: 1901, col: 30, offset: 70502}, expr: &actionExpr{ - pos: position{line: 1857, col: 31, offset: 69000}, + pos: position{line: 1901, col: 31, offset: 70503}, run: (*parser).callonQuoteBlockVerbatimElement2, expr: &seqExpr{ - pos: position{line: 1857, col: 31, offset: 69000}, + pos: position{line: 1901, col: 31, offset: 70503}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1857, col: 31, offset: 69000}, + pos: position{line: 1901, col: 31, offset: 70503}, expr: &ruleRefExpr{ - pos: position{line: 1857, col: 32, offset: 69001}, + pos: position{line: 1901, col: 32, offset: 70504}, name: "QuoteBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1857, col: 55, offset: 69024}, + pos: position{line: 1901, col: 55, offset: 70527}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1857, col: 61, offset: 69030}, + pos: position{line: 1901, col: 61, offset: 70533}, name: "DelimitedBlockRawLine", }, }, @@ -13713,25 +13458,25 @@ var g = &grammar{ }, { name: "SidebarBlockDelimiter", - pos: position{line: 1864, col: 1, offset: 69370}, + pos: position{line: 1908, col: 1, offset: 70873}, expr: &seqExpr{ - pos: position{line: 1864, col: 26, offset: 69395}, + pos: position{line: 1908, col: 26, offset: 70898}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1864, col: 26, offset: 69395}, + pos: position{line: 1908, col: 26, offset: 70898}, val: "****", ignoreCase: false, want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1864, col: 33, offset: 69402}, + pos: position{line: 1908, col: 33, offset: 70905}, expr: &ruleRefExpr{ - pos: position{line: 1864, col: 33, offset: 69402}, + pos: position{line: 1908, col: 33, offset: 70905}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1864, col: 40, offset: 69409}, + pos: position{line: 1908, col: 40, offset: 70912}, name: "EOL", }, }, @@ -13739,25 +13484,25 @@ var g = &grammar{ }, { name: "SidebarBlockStartDelimiter", - pos: position{line: 1866, col: 1, offset: 69414}, + pos: position{line: 1910, col: 1, offset: 70917}, expr: &seqExpr{ - pos: position{line: 1866, col: 31, offset: 69444}, + pos: position{line: 1910, col: 31, offset: 70947}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1866, col: 31, offset: 69444}, + pos: position{line: 1910, col: 31, offset: 70947}, val: "****", ignoreCase: false, want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1866, col: 38, offset: 69451}, + pos: position{line: 1910, col: 38, offset: 70954}, expr: &ruleRefExpr{ - pos: position{line: 1866, col: 38, offset: 69451}, + pos: position{line: 1910, col: 38, offset: 70954}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1866, col: 45, offset: 69458}, + pos: position{line: 1910, col: 45, offset: 70961}, name: "EOL", }, }, @@ -13765,34 +13510,34 @@ var g = &grammar{ }, { name: "SidebarBlockEndDelimiter", - pos: position{line: 1868, col: 1, offset: 69463}, + pos: position{line: 1912, col: 1, offset: 70966}, expr: &choiceExpr{ - pos: position{line: 1868, col: 29, offset: 69491}, + pos: position{line: 1912, col: 29, offset: 70994}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1868, col: 30, offset: 69492}, + pos: position{line: 1912, col: 30, offset: 70995}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1868, col: 30, offset: 69492}, + pos: position{line: 1912, col: 30, offset: 70995}, val: "****", ignoreCase: false, want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1868, col: 37, offset: 69499}, + pos: position{line: 1912, col: 37, offset: 71002}, expr: &ruleRefExpr{ - pos: position{line: 1868, col: 37, offset: 69499}, + pos: position{line: 1912, col: 37, offset: 71002}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1868, col: 44, offset: 69506}, + pos: position{line: 1912, col: 44, offset: 71009}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1868, col: 51, offset: 69513}, + pos: position{line: 1912, col: 51, offset: 71016}, name: "EOF", }, }, @@ -13800,38 +13545,38 @@ var g = &grammar{ }, { name: "SidebarBlock", - pos: position{line: 1870, col: 1, offset: 69518}, + pos: position{line: 1914, col: 1, offset: 71021}, expr: &actionExpr{ - pos: position{line: 1870, col: 17, offset: 69534}, + pos: position{line: 1914, col: 17, offset: 71037}, run: (*parser).callonSidebarBlock1, expr: &seqExpr{ - pos: position{line: 1870, col: 17, offset: 69534}, + pos: position{line: 1914, col: 17, offset: 71037}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1870, col: 17, offset: 69534}, + pos: position{line: 1914, col: 17, offset: 71037}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1870, col: 28, offset: 69545}, + pos: position{line: 1914, col: 28, offset: 71048}, expr: &ruleRefExpr{ - pos: position{line: 1870, col: 29, offset: 69546}, + pos: position{line: 1914, col: 29, offset: 71049}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1870, col: 42, offset: 69559}, + pos: position{line: 1914, col: 42, offset: 71062}, name: "SidebarBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1870, col: 69, offset: 69586}, + pos: position{line: 1914, col: 69, offset: 71089}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1870, col: 78, offset: 69595}, + pos: position{line: 1914, col: 78, offset: 71098}, name: "SidebarBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 1870, col: 102, offset: 69619}, + pos: position{line: 1914, col: 102, offset: 71122}, name: "SidebarBlockEndDelimiter", }, }, @@ -13840,27 +13585,27 @@ var g = &grammar{ }, { name: "SidebarBlockRawContent", - pos: position{line: 1874, col: 1, offset: 69736}, + pos: position{line: 1918, col: 1, offset: 71239}, expr: &zeroOrMoreExpr{ - pos: position{line: 1874, col: 27, offset: 69762}, + pos: position{line: 1918, col: 27, offset: 71265}, expr: &actionExpr{ - pos: position{line: 1874, col: 28, offset: 69763}, + pos: position{line: 1918, col: 28, offset: 71266}, run: (*parser).callonSidebarBlockRawContent2, expr: &seqExpr{ - pos: position{line: 1874, col: 28, offset: 69763}, + pos: position{line: 1918, col: 28, offset: 71266}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1874, col: 28, offset: 69763}, + pos: position{line: 1918, col: 28, offset: 71266}, expr: &ruleRefExpr{ - pos: position{line: 1874, col: 29, offset: 69764}, + pos: position{line: 1918, col: 29, offset: 71267}, name: "SidebarBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1874, col: 54, offset: 69789}, + pos: position{line: 1918, col: 54, offset: 71292}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1874, col: 60, offset: 69795}, + pos: position{line: 1918, col: 60, offset: 71298}, name: "DelimitedBlockRawLine", }, }, @@ -13871,25 +13616,25 @@ var g = &grammar{ }, { name: "PassthroughBlockDelimiter", - pos: position{line: 1881, col: 1, offset: 70139}, + pos: position{line: 1925, col: 1, offset: 71642}, expr: &seqExpr{ - pos: position{line: 1881, col: 30, offset: 70168}, + pos: position{line: 1925, col: 30, offset: 71671}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1881, col: 30, offset: 70168}, + pos: position{line: 1925, col: 30, offset: 71671}, val: "++++", ignoreCase: false, want: "\"++++\"", }, &zeroOrMoreExpr{ - pos: position{line: 1881, col: 37, offset: 70175}, + pos: position{line: 1925, col: 37, offset: 71678}, expr: &ruleRefExpr{ - pos: position{line: 1881, col: 37, offset: 70175}, + pos: position{line: 1925, col: 37, offset: 71678}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1881, col: 44, offset: 70182}, + pos: position{line: 1925, col: 44, offset: 71685}, name: "EOL", }, }, @@ -13897,25 +13642,25 @@ var g = &grammar{ }, { name: "PassthroughBlockStartDelimiter", - pos: position{line: 1883, col: 1, offset: 70187}, + pos: position{line: 1927, col: 1, offset: 71690}, expr: &seqExpr{ - pos: position{line: 1883, col: 35, offset: 70221}, + pos: position{line: 1927, col: 35, offset: 71724}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1883, col: 35, offset: 70221}, + pos: position{line: 1927, col: 35, offset: 71724}, val: "++++", ignoreCase: false, want: "\"++++\"", }, &zeroOrMoreExpr{ - pos: position{line: 1883, col: 42, offset: 70228}, + pos: position{line: 1927, col: 42, offset: 71731}, expr: &ruleRefExpr{ - pos: position{line: 1883, col: 42, offset: 70228}, + pos: position{line: 1927, col: 42, offset: 71731}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1883, col: 49, offset: 70235}, + pos: position{line: 1927, col: 49, offset: 71738}, name: "EOL", }, }, @@ -13923,34 +13668,34 @@ var g = &grammar{ }, { name: "PassthroughBlockEndDelimiter", - pos: position{line: 1885, col: 1, offset: 70240}, + pos: position{line: 1929, col: 1, offset: 71743}, expr: &choiceExpr{ - pos: position{line: 1885, col: 33, offset: 70272}, + pos: position{line: 1929, col: 33, offset: 71775}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1885, col: 34, offset: 70273}, + pos: position{line: 1929, col: 34, offset: 71776}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1885, col: 34, offset: 70273}, + pos: position{line: 1929, col: 34, offset: 71776}, val: "++++", ignoreCase: false, want: "\"++++\"", }, &zeroOrMoreExpr{ - pos: position{line: 1885, col: 41, offset: 70280}, + pos: position{line: 1929, col: 41, offset: 71783}, expr: &ruleRefExpr{ - pos: position{line: 1885, col: 41, offset: 70280}, + pos: position{line: 1929, col: 41, offset: 71783}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1885, col: 48, offset: 70287}, + pos: position{line: 1929, col: 48, offset: 71790}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1885, col: 55, offset: 70294}, + pos: position{line: 1929, col: 55, offset: 71797}, name: "EOF", }, }, @@ -13958,38 +13703,38 @@ var g = &grammar{ }, { name: "PassthroughBlock", - pos: position{line: 1887, col: 1, offset: 70299}, + pos: position{line: 1931, col: 1, offset: 71802}, expr: &actionExpr{ - pos: position{line: 1887, col: 21, offset: 70319}, + pos: position{line: 1931, col: 21, offset: 71822}, run: (*parser).callonPassthroughBlock1, expr: &seqExpr{ - pos: position{line: 1887, col: 21, offset: 70319}, + pos: position{line: 1931, col: 21, offset: 71822}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1887, col: 21, offset: 70319}, + pos: position{line: 1931, col: 21, offset: 71822}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1887, col: 32, offset: 70330}, + pos: position{line: 1931, col: 32, offset: 71833}, expr: &ruleRefExpr{ - pos: position{line: 1887, col: 33, offset: 70331}, + pos: position{line: 1931, col: 33, offset: 71834}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1887, col: 46, offset: 70344}, + pos: position{line: 1931, col: 46, offset: 71847}, name: "PassthroughBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1887, col: 77, offset: 70375}, + pos: position{line: 1931, col: 77, offset: 71878}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1887, col: 86, offset: 70384}, + pos: position{line: 1931, col: 86, offset: 71887}, name: "PassthroughBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 1887, col: 114, offset: 70412}, + pos: position{line: 1931, col: 114, offset: 71915}, name: "PassthroughBlockEndDelimiter", }, }, @@ -13998,27 +13743,27 @@ var g = &grammar{ }, { name: "PassthroughBlockRawContent", - pos: position{line: 1891, col: 1, offset: 70537}, + pos: position{line: 1935, col: 1, offset: 72040}, expr: &zeroOrMoreExpr{ - pos: position{line: 1891, col: 31, offset: 70567}, + pos: position{line: 1935, col: 31, offset: 72070}, expr: &actionExpr{ - pos: position{line: 1891, col: 32, offset: 70568}, + pos: position{line: 1935, col: 32, offset: 72071}, run: (*parser).callonPassthroughBlockRawContent2, expr: &seqExpr{ - pos: position{line: 1891, col: 32, offset: 70568}, + pos: position{line: 1935, col: 32, offset: 72071}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1891, col: 32, offset: 70568}, + pos: position{line: 1935, col: 32, offset: 72071}, expr: &ruleRefExpr{ - pos: position{line: 1891, col: 33, offset: 70569}, + pos: position{line: 1935, col: 33, offset: 72072}, name: "PassthroughBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1891, col: 62, offset: 70598}, + pos: position{line: 1935, col: 62, offset: 72101}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 1891, col: 68, offset: 70604}, + pos: position{line: 1935, col: 68, offset: 72107}, name: "DelimitedBlockRawLine", }, }, @@ -14029,48 +13774,48 @@ var g = &grammar{ }, { name: "ThematicBreak", - pos: position{line: 1896, col: 1, offset: 70766}, + pos: position{line: 1940, col: 1, offset: 72269}, expr: &actionExpr{ - pos: position{line: 1896, col: 18, offset: 70783}, + pos: position{line: 1940, col: 18, offset: 72286}, run: (*parser).callonThematicBreak1, expr: &seqExpr{ - pos: position{line: 1896, col: 18, offset: 70783}, + pos: position{line: 1940, col: 18, offset: 72286}, exprs: []interface{}{ &choiceExpr{ - pos: position{line: 1896, col: 19, offset: 70784}, + pos: position{line: 1940, col: 19, offset: 72287}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1896, col: 19, offset: 70784}, + pos: position{line: 1940, col: 19, offset: 72287}, val: "***", ignoreCase: false, want: "\"***\"", }, &litMatcher{ - pos: position{line: 1896, col: 27, offset: 70792}, + pos: position{line: 1940, col: 27, offset: 72295}, val: "* * *", ignoreCase: false, want: "\"* * *\"", }, &litMatcher{ - pos: position{line: 1896, col: 37, offset: 70802}, + pos: position{line: 1940, col: 37, offset: 72305}, val: "---", ignoreCase: false, want: "\"---\"", }, &litMatcher{ - pos: position{line: 1896, col: 45, offset: 70810}, + pos: position{line: 1940, col: 45, offset: 72313}, val: "- - -", ignoreCase: false, want: "\"- - -\"", }, &litMatcher{ - pos: position{line: 1896, col: 55, offset: 70820}, + pos: position{line: 1940, col: 55, offset: 72323}, val: "___", ignoreCase: false, want: "\"___\"", }, &litMatcher{ - pos: position{line: 1896, col: 63, offset: 70828}, + pos: position{line: 1940, col: 63, offset: 72331}, val: "_ _ _", ignoreCase: false, want: "\"_ _ _\"", @@ -14078,7 +13823,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1896, col: 72, offset: 70837}, + pos: position{line: 1940, col: 72, offset: 72340}, name: "EOL", }, }, @@ -14087,78 +13832,74 @@ var g = &grammar{ }, { name: "NormalParagraphContentSubstitution", - pos: position{line: 1906, col: 1, offset: 71219}, + pos: position{line: 1951, col: 1, offset: 72739}, expr: &oneOrMoreExpr{ - pos: position{line: 1907, col: 5, offset: 71264}, + pos: position{line: 1952, col: 5, offset: 72784}, expr: &choiceExpr{ - pos: position{line: 1907, col: 9, offset: 71268}, + pos: position{line: 1952, col: 9, offset: 72788}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1907, col: 9, offset: 71268}, + pos: position{line: 1952, col: 9, offset: 72788}, name: "SingleLineComment", }, &seqExpr{ - pos: position{line: 1908, col: 13, offset: 71300}, + pos: position{line: 1953, col: 13, offset: 72820}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1908, col: 13, offset: 71300}, + pos: position{line: 1953, col: 13, offset: 72820}, expr: &choiceExpr{ - pos: position{line: 1908, col: 14, offset: 71301}, + pos: position{line: 1953, col: 14, offset: 72821}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1908, col: 14, offset: 71301}, + pos: position{line: 1953, col: 14, offset: 72821}, name: "InlineWord", }, &ruleRefExpr{ - pos: position{line: 1909, col: 15, offset: 71356}, + pos: position{line: 1954, col: 15, offset: 72886}, name: "LineBreak", }, &oneOrMoreExpr{ - pos: position{line: 1910, col: 15, offset: 71405}, + pos: position{line: 1955, col: 15, offset: 72935}, expr: &ruleRefExpr{ - pos: position{line: 1910, col: 15, offset: 71405}, + pos: position{line: 1955, col: 15, offset: 72935}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1911, col: 15, offset: 71427}, + pos: position{line: 1956, col: 15, offset: 72957}, name: "Quotes", }, &ruleRefExpr{ - pos: position{line: 1912, col: 15, offset: 71448}, + pos: position{line: 1957, col: 15, offset: 72978}, name: "InlineMacros", }, &ruleRefExpr{ - pos: position{line: 1913, col: 15, offset: 71475}, + pos: position{line: 1958, col: 15, offset: 73005}, name: "Symbol", }, &ruleRefExpr{ - pos: position{line: 1914, col: 15, offset: 71496}, + pos: position{line: 1959, col: 15, offset: 73026}, name: "SpecialCharacter", }, &ruleRefExpr{ - pos: position{line: 1915, col: 15, offset: 71527}, + pos: position{line: 1960, col: 15, offset: 73057}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 1916, col: 15, offset: 71555}, + pos: position{line: 1961, col: 15, offset: 73085}, name: "ImpliedApostrophe", }, &ruleRefExpr{ - pos: position{line: 1917, col: 15, offset: 71587}, - name: "AttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 1918, col: 15, offset: 71623}, + pos: position{line: 1962, col: 15, offset: 73117}, name: "AnyChar", }, }, }, }, &zeroOrOneExpr{ - pos: position{line: 1919, col: 16, offset: 71646}, + pos: position{line: 1963, col: 16, offset: 73140}, expr: &ruleRefExpr{ - pos: position{line: 1919, col: 16, offset: 71646}, + pos: position{line: 1963, col: 16, offset: 73140}, name: "Newline", }, }, @@ -14170,100 +13911,151 @@ var g = &grammar{ }, { name: "Quotes", - pos: position{line: 1922, col: 1, offset: 71664}, + pos: position{line: 1966, col: 1, offset: 73158}, expr: &ruleRefExpr{ - pos: position{line: 1922, col: 11, offset: 71674}, + pos: position{line: 1966, col: 11, offset: 73168}, name: "QuotedText", }, }, { name: "InlineMacros", - pos: position{line: 1924, col: 1, offset: 71686}, + pos: position{line: 1968, col: 1, offset: 73180}, expr: &choiceExpr{ - pos: position{line: 1924, col: 17, offset: 71702}, + pos: position{line: 1968, col: 17, offset: 73196}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1924, col: 17, offset: 71702}, + pos: position{line: 1968, col: 17, offset: 73196}, name: "InlineIcon", }, &ruleRefExpr{ - pos: position{line: 1925, col: 19, offset: 71731}, + pos: position{line: 1969, col: 19, offset: 73225}, name: "InlineImage", }, &ruleRefExpr{ - pos: position{line: 1926, col: 19, offset: 71762}, + pos: position{line: 1970, col: 19, offset: 73256}, name: "Link", }, &ruleRefExpr{ - pos: position{line: 1927, col: 19, offset: 71786}, + pos: position{line: 1971, col: 19, offset: 73280}, name: "InlinePassthrough", }, &ruleRefExpr{ - pos: position{line: 1928, col: 19, offset: 71823}, + pos: position{line: 1972, col: 19, offset: 73317}, name: "InlineFootnote", }, &ruleRefExpr{ - pos: position{line: 1929, col: 19, offset: 71857}, + pos: position{line: 1973, col: 19, offset: 73351}, name: "CrossReference", }, &ruleRefExpr{ - pos: position{line: 1930, col: 19, offset: 71891}, + pos: position{line: 1974, col: 19, offset: 73385}, name: "InlineUserMacro", }, &ruleRefExpr{ - pos: position{line: 1931, col: 19, offset: 71926}, + pos: position{line: 1975, col: 19, offset: 73420}, name: "InlineElementID", }, &ruleRefExpr{ - pos: position{line: 1932, col: 19, offset: 71960}, + pos: position{line: 1976, col: 19, offset: 73454}, name: "ConcealedIndexTerm", }, &ruleRefExpr{ - pos: position{line: 1933, col: 19, offset: 71997}, + pos: position{line: 1977, col: 19, offset: 73491}, name: "IndexTerm", }, }, }, }, + { + name: "ElementPlaceHolder", + pos: position{line: 1979, col: 1, offset: 73502}, + expr: &actionExpr{ + pos: position{line: 1979, col: 23, offset: 73524}, + run: (*parser).callonElementPlaceHolder1, + expr: &seqExpr{ + pos: position{line: 1979, col: 23, offset: 73524}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1979, col: 23, offset: 73524}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 1979, col: 32, offset: 73533}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1979, col: 37, offset: 73538}, + run: (*parser).callonElementPlaceHolder5, + expr: &oneOrMoreExpr{ + pos: position{line: 1979, col: 37, offset: 73538}, + expr: &charClassMatcher{ + pos: position{line: 1979, col: 37, offset: 73538}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1979, col: 76, offset: 73577}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + }, { name: "ReplacementsSubstitution", - pos: position{line: 1935, col: 1, offset: 72020}, + pos: position{line: 1983, col: 1, offset: 73644}, expr: &seqExpr{ - pos: position{line: 1935, col: 29, offset: 72048}, + pos: position{line: 1983, col: 29, offset: 73672}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1935, col: 29, offset: 72048}, + pos: position{line: 1983, col: 29, offset: 73672}, expr: &choiceExpr{ - pos: position{line: 1935, col: 30, offset: 72049}, + pos: position{line: 1983, col: 30, offset: 73673}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1935, col: 30, offset: 72049}, + pos: position{line: 1983, col: 30, offset: 73673}, name: "Symbol", }, &ruleRefExpr{ - pos: position{line: 1936, col: 15, offset: 72071}, + pos: position{line: 1984, col: 7, offset: 73687}, name: "InlineWord", }, &oneOrMoreExpr{ - pos: position{line: 1937, col: 15, offset: 72126}, + pos: position{line: 1985, col: 7, offset: 73744}, expr: &ruleRefExpr{ - pos: position{line: 1937, col: 15, offset: 72126}, + pos: position{line: 1985, col: 7, offset: 73744}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1938, col: 15, offset: 72148}, + pos: position{line: 1986, col: 7, offset: 73758}, + name: "ImpliedApostrophe", + }, + &ruleRefExpr{ + pos: position{line: 1987, col: 7, offset: 73782}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 1988, col: 7, offset: 73807}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 1939, col: 15, offset: 72170}, + pos: position{line: 1989, col: 7, offset: 73821}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 1939, col: 25, offset: 72180}, + pos: position{line: 1989, col: 17, offset: 73831}, name: "EOF", }, }, @@ -14271,95 +14063,95 @@ var g = &grammar{ }, { name: "NormalBlockContentSubstitution", - pos: position{line: 1942, col: 1, offset: 72232}, + pos: position{line: 1992, col: 1, offset: 73883}, expr: &zeroOrMoreExpr{ - pos: position{line: 1942, col: 35, offset: 72266}, + pos: position{line: 1992, col: 35, offset: 73917}, expr: &ruleRefExpr{ - pos: position{line: 1942, col: 35, offset: 72266}, + pos: position{line: 1992, col: 35, offset: 73917}, name: "NormalBlockElement", }, }, }, { name: "NormalBlockElement", - pos: position{line: 1944, col: 1, offset: 72287}, + pos: position{line: 1994, col: 1, offset: 73938}, expr: &actionExpr{ - pos: position{line: 1945, col: 5, offset: 72314}, + pos: position{line: 1995, col: 5, offset: 73965}, run: (*parser).callonNormalBlockElement1, expr: &seqExpr{ - pos: position{line: 1945, col: 5, offset: 72314}, + pos: position{line: 1995, col: 5, offset: 73965}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1945, col: 5, offset: 72314}, + pos: position{line: 1995, col: 5, offset: 73965}, expr: &ruleRefExpr{ - pos: position{line: 1945, col: 6, offset: 72315}, + pos: position{line: 1995, col: 6, offset: 73966}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 1945, col: 10, offset: 72319}, + pos: position{line: 1995, col: 10, offset: 73970}, label: "element", expr: &choiceExpr{ - pos: position{line: 1945, col: 19, offset: 72328}, + pos: position{line: 1995, col: 19, offset: 73979}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1945, col: 19, offset: 72328}, + pos: position{line: 1995, col: 19, offset: 73979}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 1946, col: 15, offset: 72353}, + pos: position{line: 1996, col: 15, offset: 74004}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 1947, col: 15, offset: 72381}, + pos: position{line: 1997, col: 15, offset: 74032}, name: "ImageBlock", }, &ruleRefExpr{ - pos: position{line: 1948, col: 15, offset: 72406}, + pos: position{line: 1998, col: 15, offset: 74057}, name: "ThematicBreak", }, &ruleRefExpr{ - pos: position{line: 1949, col: 15, offset: 72434}, + pos: position{line: 1999, col: 15, offset: 74085}, name: "OrderedListItem", }, &ruleRefExpr{ - pos: position{line: 1950, col: 15, offset: 72465}, + pos: position{line: 2000, col: 15, offset: 74116}, name: "UnorderedListItem", }, &ruleRefExpr{ - pos: position{line: 1951, col: 15, offset: 72498}, + pos: position{line: 2001, col: 15, offset: 74149}, name: "LabeledListItem", }, &ruleRefExpr{ - pos: position{line: 1952, col: 15, offset: 72529}, + pos: position{line: 2002, col: 15, offset: 74180}, name: "ContinuedListItemElement", }, &ruleRefExpr{ - pos: position{line: 1953, col: 15, offset: 72568}, + pos: position{line: 2003, col: 15, offset: 74219}, name: "DelimitedBlock", }, &ruleRefExpr{ - pos: position{line: 1954, col: 15, offset: 72597}, + pos: position{line: 2004, col: 15, offset: 74248}, name: "LiteralBlock", }, &ruleRefExpr{ - pos: position{line: 1955, col: 15, offset: 72625}, + pos: position{line: 2005, col: 15, offset: 74276}, name: "AttributeDeclaration", }, &ruleRefExpr{ - pos: position{line: 1956, col: 15, offset: 72661}, + pos: position{line: 2006, col: 15, offset: 74312}, name: "AttributeReset", }, &ruleRefExpr{ - pos: position{line: 1957, col: 15, offset: 72691}, + pos: position{line: 2007, col: 15, offset: 74342}, name: "TableOfContentsPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1958, col: 15, offset: 72732}, + pos: position{line: 2008, col: 15, offset: 74383}, name: "StandaloneAttributes", }, &ruleRefExpr{ - pos: position{line: 1959, col: 15, offset: 72767}, + pos: position{line: 2009, col: 15, offset: 74418}, name: "Paragraph", }, }, @@ -14371,42 +14163,42 @@ var g = &grammar{ }, { name: "VerbatimContentSubstitution", - pos: position{line: 1963, col: 1, offset: 72816}, + pos: position{line: 2013, col: 1, offset: 74467}, expr: &ruleRefExpr{ - pos: position{line: 1963, col: 32, offset: 72847}, + pos: position{line: 2013, col: 32, offset: 74498}, name: "VerbatimLine", }, }, { name: "VerbatimLine", - pos: position{line: 1965, col: 1, offset: 72861}, + pos: position{line: 2015, col: 1, offset: 74512}, expr: &actionExpr{ - pos: position{line: 1965, col: 17, offset: 72877}, + pos: position{line: 2015, col: 17, offset: 74528}, run: (*parser).callonVerbatimLine1, expr: &seqExpr{ - pos: position{line: 1965, col: 17, offset: 72877}, + pos: position{line: 2015, col: 17, offset: 74528}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1965, col: 17, offset: 72877}, + pos: position{line: 2015, col: 17, offset: 74528}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1965, col: 26, offset: 72886}, + pos: position{line: 2015, col: 26, offset: 74537}, name: "VerbatimLineContent", }, }, &labeledExpr{ - pos: position{line: 1965, col: 47, offset: 72907}, + pos: position{line: 2015, col: 47, offset: 74558}, label: "callouts", expr: &zeroOrOneExpr{ - pos: position{line: 1965, col: 56, offset: 72916}, + pos: position{line: 2015, col: 56, offset: 74567}, expr: &ruleRefExpr{ - pos: position{line: 1965, col: 57, offset: 72917}, + pos: position{line: 2015, col: 57, offset: 74568}, name: "Callouts", }, }, }, &ruleRefExpr{ - pos: position{line: 1965, col: 68, offset: 72928}, + pos: position{line: 2015, col: 68, offset: 74579}, name: "EOL", }, }, @@ -14415,36 +14207,36 @@ var g = &grammar{ }, { name: "VerbatimLineContent", - pos: position{line: 1969, col: 1, offset: 72998}, + pos: position{line: 2019, col: 1, offset: 74649}, expr: &actionExpr{ - pos: position{line: 1969, col: 24, offset: 73021}, + pos: position{line: 2019, col: 24, offset: 74672}, run: (*parser).callonVerbatimLineContent1, expr: &zeroOrMoreExpr{ - pos: position{line: 1969, col: 24, offset: 73021}, + pos: position{line: 2019, col: 24, offset: 74672}, expr: &seqExpr{ - pos: position{line: 1969, col: 25, offset: 73022}, + pos: position{line: 2019, col: 25, offset: 74673}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1969, col: 25, offset: 73022}, + pos: position{line: 2019, col: 25, offset: 74673}, expr: &ruleRefExpr{ - pos: position{line: 1969, col: 26, offset: 73023}, + pos: position{line: 2019, col: 26, offset: 74674}, name: "Callouts", }, }, &choiceExpr{ - pos: position{line: 1969, col: 36, offset: 73033}, + pos: position{line: 2019, col: 36, offset: 74684}, alternatives: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1969, col: 36, offset: 73033}, + pos: position{line: 2019, col: 36, offset: 74684}, expr: &ruleRefExpr{ - pos: position{line: 1969, col: 36, offset: 73033}, + pos: position{line: 2019, col: 36, offset: 74684}, name: "Space", }, }, &oneOrMoreExpr{ - pos: position{line: 1969, col: 45, offset: 73042}, + pos: position{line: 2019, col: 45, offset: 74693}, expr: &charClassMatcher{ - pos: position{line: 1969, col: 45, offset: 73042}, + pos: position{line: 2019, col: 45, offset: 74693}, val: "[^ \\r\\n]", chars: []rune{' ', '\r', '\n'}, ignoreCase: false, @@ -14460,40 +14252,40 @@ var g = &grammar{ }, { name: "Callouts", - pos: position{line: 1973, col: 1, offset: 73092}, + pos: position{line: 2023, col: 1, offset: 74743}, expr: &oneOrMoreExpr{ - pos: position{line: 1973, col: 13, offset: 73104}, + pos: position{line: 2023, col: 13, offset: 74755}, expr: &ruleRefExpr{ - pos: position{line: 1973, col: 13, offset: 73104}, + pos: position{line: 2023, col: 13, offset: 74755}, name: "Callout", }, }, }, { name: "Callout", - pos: position{line: 1975, col: 1, offset: 73114}, + pos: position{line: 2025, col: 1, offset: 74765}, expr: &actionExpr{ - pos: position{line: 1975, col: 12, offset: 73125}, + pos: position{line: 2025, col: 12, offset: 74776}, run: (*parser).callonCallout1, expr: &seqExpr{ - pos: position{line: 1975, col: 12, offset: 73125}, + pos: position{line: 2025, col: 12, offset: 74776}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1975, col: 12, offset: 73125}, + pos: position{line: 2025, col: 12, offset: 74776}, val: "<", ignoreCase: false, want: "\"<\"", }, &labeledExpr{ - pos: position{line: 1975, col: 16, offset: 73129}, + pos: position{line: 2025, col: 16, offset: 74780}, label: "ref", expr: &actionExpr{ - pos: position{line: 1975, col: 21, offset: 73134}, + pos: position{line: 2025, col: 21, offset: 74785}, run: (*parser).callonCallout5, expr: &oneOrMoreExpr{ - pos: position{line: 1975, col: 21, offset: 73134}, + pos: position{line: 2025, col: 21, offset: 74785}, expr: &charClassMatcher{ - pos: position{line: 1975, col: 21, offset: 73134}, + pos: position{line: 2025, col: 21, offset: 74785}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -14503,29 +14295,29 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1975, col: 69, offset: 73182}, + pos: position{line: 2025, col: 69, offset: 74833}, val: ">", ignoreCase: false, want: "\">\"", }, &zeroOrMoreExpr{ - pos: position{line: 1975, col: 73, offset: 73186}, + pos: position{line: 2025, col: 73, offset: 74837}, expr: &ruleRefExpr{ - pos: position{line: 1975, col: 73, offset: 73186}, + pos: position{line: 2025, col: 73, offset: 74837}, name: "Space", }, }, &andExpr{ - pos: position{line: 1975, col: 80, offset: 73193}, + pos: position{line: 2025, col: 80, offset: 74844}, expr: &choiceExpr{ - pos: position{line: 1975, col: 82, offset: 73195}, + pos: position{line: 2025, col: 82, offset: 74846}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1975, col: 82, offset: 73195}, + pos: position{line: 2025, col: 82, offset: 74846}, name: "EOL", }, &ruleRefExpr{ - pos: position{line: 1975, col: 88, offset: 73201}, + pos: position{line: 2025, col: 88, offset: 74852}, name: "Callout", }, }, @@ -14535,41 +14327,139 @@ var g = &grammar{ }, }, }, + { + name: "InlinePassthroughSubstitution", + pos: position{line: 2030, col: 1, offset: 74959}, + expr: &actionExpr{ + pos: position{line: 2031, col: 5, offset: 74997}, + run: (*parser).callonInlinePassthroughSubstitution1, + expr: &labeledExpr{ + pos: position{line: 2031, col: 5, offset: 74997}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2031, col: 14, offset: 75006}, + expr: &choiceExpr{ + pos: position{line: 2031, col: 15, offset: 75007}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2031, col: 15, offset: 75007}, + name: "InlinePassthrough", + }, + &ruleRefExpr{ + pos: position{line: 2032, col: 11, offset: 75036}, + name: "InlineWord", + }, + &oneOrMoreExpr{ + pos: position{line: 2033, col: 11, offset: 75097}, + expr: &ruleRefExpr{ + pos: position{line: 2033, col: 11, offset: 75097}, + name: "Space", + }, + }, + &ruleRefExpr{ + pos: position{line: 2034, col: 11, offset: 75115}, + name: "AnyChar", + }, + &ruleRefExpr{ + pos: position{line: 2035, col: 11, offset: 75133}, + name: "Newline", + }, + }, + }, + }, + }, + }, + }, { name: "QuotedTextSubstitution", - pos: position{line: 1980, col: 1, offset: 73303}, + pos: position{line: 2040, col: 1, offset: 75274}, expr: &actionExpr{ - pos: position{line: 1981, col: 5, offset: 73334}, + pos: position{line: 2041, col: 5, offset: 75305}, run: (*parser).callonQuotedTextSubstitution1, expr: &labeledExpr{ - pos: position{line: 1981, col: 5, offset: 73334}, + pos: position{line: 2041, col: 5, offset: 75305}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2041, col: 14, offset: 75314}, + expr: &choiceExpr{ + pos: position{line: 2041, col: 15, offset: 75315}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2041, col: 15, offset: 75315}, + name: "InlineWord", + }, + &oneOrMoreExpr{ + pos: position{line: 2042, col: 11, offset: 75376}, + expr: &ruleRefExpr{ + pos: position{line: 2042, col: 11, offset: 75376}, + name: "Space", + }, + }, + &ruleRefExpr{ + pos: position{line: 2043, col: 11, offset: 75394}, + name: "QuotedText", + }, + &ruleRefExpr{ + pos: position{line: 2044, col: 11, offset: 75416}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2045, col: 11, offset: 75439}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 2046, col: 11, offset: 75468}, + name: "AnyChar", + }, + &ruleRefExpr{ + pos: position{line: 2047, col: 11, offset: 75486}, + name: "Newline", + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextAndInlineMacrosSubstitution", + pos: position{line: 2053, col: 1, offset: 75653}, + expr: &actionExpr{ + pos: position{line: 2054, col: 5, offset: 75699}, + run: (*parser).callonQuotedTextAndInlineMacrosSubstitution1, + expr: &labeledExpr{ + pos: position{line: 2054, col: 5, offset: 75699}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1981, col: 14, offset: 73343}, + pos: position{line: 2054, col: 14, offset: 75708}, expr: &choiceExpr{ - pos: position{line: 1981, col: 15, offset: 73344}, + pos: position{line: 2054, col: 15, offset: 75709}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1981, col: 15, offset: 73344}, + pos: position{line: 2054, col: 15, offset: 75709}, name: "InlineWord", }, &oneOrMoreExpr{ - pos: position{line: 1982, col: 11, offset: 73395}, + pos: position{line: 2055, col: 11, offset: 75770}, expr: &ruleRefExpr{ - pos: position{line: 1982, col: 11, offset: 73395}, + pos: position{line: 2055, col: 11, offset: 75770}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1983, col: 11, offset: 73413}, + pos: position{line: 2056, col: 11, offset: 75788}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1984, col: 11, offset: 73435}, + pos: position{line: 2057, col: 11, offset: 75809}, + name: "InlineMacros", + }, + &ruleRefExpr{ + pos: position{line: 2058, col: 11, offset: 75832}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 1985, col: 11, offset: 73453}, + pos: position{line: 2059, col: 11, offset: 75850}, name: "Newline", }, }, @@ -14580,39 +14470,43 @@ var g = &grammar{ }, { name: "InlineMacrosSubstitution", - pos: position{line: 1990, col: 1, offset: 73594}, + pos: position{line: 2064, col: 1, offset: 75991}, expr: &actionExpr{ - pos: position{line: 1991, col: 5, offset: 73627}, + pos: position{line: 2065, col: 5, offset: 76024}, run: (*parser).callonInlineMacrosSubstitution1, expr: &labeledExpr{ - pos: position{line: 1991, col: 5, offset: 73627}, + pos: position{line: 2065, col: 5, offset: 76024}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1991, col: 14, offset: 73636}, + pos: position{line: 2065, col: 14, offset: 76033}, expr: &choiceExpr{ - pos: position{line: 1991, col: 15, offset: 73637}, + pos: position{line: 2065, col: 15, offset: 76034}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1991, col: 15, offset: 73637}, + pos: position{line: 2065, col: 15, offset: 76034}, name: "InlineWord", }, &oneOrMoreExpr{ - pos: position{line: 1992, col: 11, offset: 73688}, + pos: position{line: 2066, col: 11, offset: 76095}, expr: &ruleRefExpr{ - pos: position{line: 1992, col: 11, offset: 73688}, + pos: position{line: 2066, col: 11, offset: 76095}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1993, col: 11, offset: 73706}, + pos: position{line: 2067, col: 11, offset: 76113}, name: "InlineMacros", }, &ruleRefExpr{ - pos: position{line: 1994, col: 11, offset: 73729}, + pos: position{line: 2068, col: 11, offset: 76136}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 2069, col: 11, offset: 76165}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 1995, col: 11, offset: 73747}, + pos: position{line: 2070, col: 11, offset: 76183}, name: "Newline", }, }, @@ -14623,39 +14517,43 @@ var g = &grammar{ }, { name: "AttributesSubstitution", - pos: position{line: 2000, col: 1, offset: 73892}, + pos: position{line: 2075, col: 1, offset: 76328}, expr: &actionExpr{ - pos: position{line: 2001, col: 5, offset: 73923}, + pos: position{line: 2076, col: 5, offset: 76359}, run: (*parser).callonAttributesSubstitution1, expr: &labeledExpr{ - pos: position{line: 2001, col: 5, offset: 73923}, + pos: position{line: 2076, col: 5, offset: 76359}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2001, col: 14, offset: 73932}, + pos: position{line: 2076, col: 14, offset: 76368}, expr: &choiceExpr{ - pos: position{line: 2001, col: 15, offset: 73933}, + pos: position{line: 2076, col: 15, offset: 76369}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2001, col: 15, offset: 73933}, + pos: position{line: 2076, col: 15, offset: 76369}, name: "InlineWord", }, &oneOrMoreExpr{ - pos: position{line: 2002, col: 11, offset: 73984}, + pos: position{line: 2077, col: 11, offset: 76430}, expr: &ruleRefExpr{ - pos: position{line: 2002, col: 11, offset: 73984}, + pos: position{line: 2077, col: 11, offset: 76430}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2003, col: 11, offset: 74002}, + pos: position{line: 2078, col: 11, offset: 76448}, name: "AttributeSubstitution", }, &ruleRefExpr{ - pos: position{line: 2004, col: 11, offset: 74034}, + pos: position{line: 2079, col: 11, offset: 76480}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 2080, col: 11, offset: 76509}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 2005, col: 11, offset: 74052}, + pos: position{line: 2081, col: 11, offset: 76527}, name: "Newline", }, }, @@ -14666,62 +14564,110 @@ var g = &grammar{ }, { name: "SpecialCharactersSubstitution", - pos: position{line: 2009, col: 1, offset: 74143}, + pos: position{line: 2085, col: 1, offset: 76618}, expr: &actionExpr{ - pos: position{line: 2010, col: 5, offset: 74181}, + pos: position{line: 2086, col: 5, offset: 76656}, run: (*parser).callonSpecialCharactersSubstitution1, expr: &labeledExpr{ - pos: position{line: 2010, col: 5, offset: 74181}, + pos: position{line: 2086, col: 5, offset: 76656}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2010, col: 14, offset: 74190}, + pos: position{line: 2086, col: 14, offset: 76665}, expr: &choiceExpr{ - pos: position{line: 2010, col: 15, offset: 74191}, + pos: position{line: 2086, col: 15, offset: 76666}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2010, col: 15, offset: 74191}, + pos: position{line: 2086, col: 15, offset: 76666}, name: "SpecialCharacter", }, &ruleRefExpr{ - pos: position{line: 2011, col: 11, offset: 74218}, + pos: position{line: 2087, col: 11, offset: 76693}, name: "Word", }, &oneOrMoreExpr{ - pos: position{line: 2012, col: 11, offset: 74233}, + pos: position{line: 2088, col: 11, offset: 76708}, + expr: &ruleRefExpr{ + pos: position{line: 2088, col: 11, offset: 76708}, + name: "Space", + }, + }, + &ruleRefExpr{ + pos: position{line: 2089, col: 11, offset: 76725}, + name: "AnyChar", + }, + &ruleRefExpr{ + pos: position{line: 2090, col: 11, offset: 76743}, + name: "Newline", + }, + }, + }, + }, + }, + }, + }, + { + name: "PostReplacementsSubstitution", + pos: position{line: 2095, col: 1, offset: 76836}, + expr: &seqExpr{ + pos: position{line: 2095, col: 33, offset: 76868}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2095, col: 33, offset: 76868}, + expr: &choiceExpr{ + pos: position{line: 2096, col: 5, offset: 76874}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2096, col: 5, offset: 76874}, + name: "InlineWord", + }, + &ruleRefExpr{ + pos: position{line: 2097, col: 7, offset: 76931}, + name: "ElementPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 2098, col: 7, offset: 76956}, + name: "LineBreak", + }, + &oneOrMoreExpr{ + pos: position{line: 2099, col: 7, offset: 76972}, expr: &ruleRefExpr{ - pos: position{line: 2012, col: 11, offset: 74233}, + pos: position{line: 2099, col: 7, offset: 76972}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2013, col: 11, offset: 74250}, + pos: position{line: 2100, col: 7, offset: 76986}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 2014, col: 11, offset: 74268}, + pos: position{line: 2101, col: 7, offset: 77000}, name: "Newline", }, }, }, }, + &ruleRefExpr{ + pos: position{line: 2101, col: 17, offset: 77010}, + name: "EOF", + }, }, }, }, { name: "NoneSubstitution", - pos: position{line: 2019, col: 1, offset: 74407}, + pos: position{line: 2104, col: 1, offset: 77062}, expr: &oneOrMoreExpr{ - pos: position{line: 2019, col: 21, offset: 74427}, + pos: position{line: 2104, col: 21, offset: 77082}, expr: &actionExpr{ - pos: position{line: 2020, col: 6, offset: 74434}, + pos: position{line: 2105, col: 6, offset: 77089}, run: (*parser).callonNoneSubstitution2, expr: &seqExpr{ - pos: position{line: 2020, col: 6, offset: 74434}, + pos: position{line: 2105, col: 6, offset: 77089}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2020, col: 6, offset: 74434}, + pos: position{line: 2105, col: 6, offset: 77089}, expr: &charClassMatcher{ - pos: position{line: 2020, col: 6, offset: 74434}, + pos: position{line: 2105, col: 6, offset: 77089}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -14729,7 +14675,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2020, col: 15, offset: 74443}, + pos: position{line: 2105, col: 15, offset: 77098}, name: "EOL", }, }, @@ -14739,43 +14685,43 @@ var g = &grammar{ }, { name: "VerseBlockContentSubstitution", - pos: position{line: 2025, col: 1, offset: 74590}, + pos: position{line: 2110, col: 1, offset: 77245}, expr: &zeroOrMoreExpr{ - pos: position{line: 2025, col: 34, offset: 74623}, + pos: position{line: 2110, col: 34, offset: 77278}, expr: &ruleRefExpr{ - pos: position{line: 2025, col: 34, offset: 74623}, + pos: position{line: 2110, col: 34, offset: 77278}, name: "VerseBlockElement", }, }, }, { name: "VerseBlockElement", - pos: position{line: 2027, col: 1, offset: 74643}, + pos: position{line: 2112, col: 1, offset: 77298}, expr: &actionExpr{ - pos: position{line: 2027, col: 22, offset: 74664}, + pos: position{line: 2112, col: 22, offset: 77319}, run: (*parser).callonVerseBlockElement1, expr: &seqExpr{ - pos: position{line: 2027, col: 22, offset: 74664}, + pos: position{line: 2112, col: 22, offset: 77319}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2027, col: 22, offset: 74664}, + pos: position{line: 2112, col: 22, offset: 77319}, expr: &ruleRefExpr{ - pos: position{line: 2027, col: 23, offset: 74665}, + pos: position{line: 2112, col: 23, offset: 77320}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 2027, col: 27, offset: 74669}, + pos: position{line: 2112, col: 27, offset: 77324}, label: "element", expr: &choiceExpr{ - pos: position{line: 2027, col: 36, offset: 74678}, + pos: position{line: 2112, col: 36, offset: 77333}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2027, col: 36, offset: 74678}, + pos: position{line: 2112, col: 36, offset: 77333}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 2027, col: 48, offset: 74690}, + pos: position{line: 2112, col: 48, offset: 77345}, name: "VerseBlockParagraph", }, }, @@ -14787,17 +14733,17 @@ var g = &grammar{ }, { name: "VerseBlockParagraph", - pos: position{line: 2031, col: 1, offset: 74740}, + pos: position{line: 2116, col: 1, offset: 77395}, expr: &actionExpr{ - pos: position{line: 2031, col: 24, offset: 74763}, + pos: position{line: 2116, col: 24, offset: 77418}, run: (*parser).callonVerseBlockParagraph1, expr: &labeledExpr{ - pos: position{line: 2031, col: 24, offset: 74763}, + pos: position{line: 2116, col: 24, offset: 77418}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 2031, col: 30, offset: 74769}, + pos: position{line: 2116, col: 30, offset: 77424}, expr: &ruleRefExpr{ - pos: position{line: 2031, col: 31, offset: 74770}, + pos: position{line: 2116, col: 31, offset: 77425}, name: "VerseBlockParagraphLine", }, }, @@ -14806,26 +14752,26 @@ var g = &grammar{ }, { name: "VerseBlockParagraphLine", - pos: position{line: 2035, col: 1, offset: 74860}, + pos: position{line: 2120, col: 1, offset: 77515}, expr: &actionExpr{ - pos: position{line: 2035, col: 28, offset: 74887}, + pos: position{line: 2120, col: 28, offset: 77542}, run: (*parser).callonVerseBlockParagraphLine1, expr: &seqExpr{ - pos: position{line: 2035, col: 28, offset: 74887}, + pos: position{line: 2120, col: 28, offset: 77542}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2035, col: 28, offset: 74887}, + pos: position{line: 2120, col: 28, offset: 77542}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2035, col: 37, offset: 74896}, + pos: position{line: 2120, col: 37, offset: 77551}, expr: &ruleRefExpr{ - pos: position{line: 2035, col: 38, offset: 74897}, + pos: position{line: 2120, col: 38, offset: 77552}, name: "InlineElement", }, }, }, &ruleRefExpr{ - pos: position{line: 2035, col: 54, offset: 74913}, + pos: position{line: 2120, col: 54, offset: 77568}, name: "EOL", }, }, @@ -14834,62 +14780,62 @@ var g = &grammar{ }, { name: "Table", - pos: position{line: 2042, col: 1, offset: 75155}, + pos: position{line: 2127, col: 1, offset: 77810}, expr: &actionExpr{ - pos: position{line: 2042, col: 10, offset: 75164}, + pos: position{line: 2127, col: 10, offset: 77819}, run: (*parser).callonTable1, expr: &seqExpr{ - pos: position{line: 2042, col: 10, offset: 75164}, + pos: position{line: 2127, col: 10, offset: 77819}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2042, col: 10, offset: 75164}, + pos: position{line: 2127, col: 10, offset: 77819}, label: "attrs", expr: &zeroOrOneExpr{ - pos: position{line: 2042, col: 16, offset: 75170}, + pos: position{line: 2127, col: 16, offset: 77825}, expr: &zeroOrMoreExpr{ - pos: position{line: 2042, col: 17, offset: 75171}, + pos: position{line: 2127, col: 17, offset: 77826}, expr: &ruleRefExpr{ - pos: position{line: 2042, col: 17, offset: 75171}, + pos: position{line: 2127, col: 17, offset: 77826}, name: "BlockAttrs", }, }, }, }, &ruleRefExpr{ - pos: position{line: 2042, col: 31, offset: 75185}, + pos: position{line: 2127, col: 31, offset: 77840}, name: "TableDelimiter", }, &labeledExpr{ - pos: position{line: 2043, col: 5, offset: 75204}, + pos: position{line: 2128, col: 5, offset: 77859}, label: "header", expr: &zeroOrOneExpr{ - pos: position{line: 2043, col: 12, offset: 75211}, + pos: position{line: 2128, col: 12, offset: 77866}, expr: &ruleRefExpr{ - pos: position{line: 2043, col: 13, offset: 75212}, + pos: position{line: 2128, col: 13, offset: 77867}, name: "TableLineHeader", }, }, }, &labeledExpr{ - pos: position{line: 2044, col: 5, offset: 75234}, + pos: position{line: 2129, col: 5, offset: 77889}, label: "lines", expr: &zeroOrMoreExpr{ - pos: position{line: 2044, col: 11, offset: 75240}, + pos: position{line: 2129, col: 11, offset: 77895}, expr: &ruleRefExpr{ - pos: position{line: 2044, col: 12, offset: 75241}, + pos: position{line: 2129, col: 12, offset: 77896}, name: "TableLine", }, }, }, &choiceExpr{ - pos: position{line: 2045, col: 6, offset: 75258}, + pos: position{line: 2130, col: 6, offset: 77913}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2045, col: 6, offset: 75258}, + pos: position{line: 2130, col: 6, offset: 77913}, name: "TableDelimiter", }, &ruleRefExpr{ - pos: position{line: 2045, col: 23, offset: 75275}, + pos: position{line: 2130, col: 23, offset: 77930}, name: "EOF", }, }, @@ -14900,20 +14846,20 @@ var g = &grammar{ }, { name: "TableCellSeparator", - pos: position{line: 2049, col: 1, offset: 75385}, + pos: position{line: 2134, col: 1, offset: 78040}, expr: &seqExpr{ - pos: position{line: 2049, col: 23, offset: 75407}, + pos: position{line: 2134, col: 23, offset: 78062}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2049, col: 23, offset: 75407}, + pos: position{line: 2134, col: 23, offset: 78062}, val: "|", ignoreCase: false, want: "\"|\"", }, &zeroOrMoreExpr{ - pos: position{line: 2049, col: 27, offset: 75411}, + pos: position{line: 2134, col: 27, offset: 78066}, expr: &ruleRefExpr{ - pos: position{line: 2049, col: 27, offset: 75411}, + pos: position{line: 2134, col: 27, offset: 78066}, name: "Space", }, }, @@ -14922,25 +14868,25 @@ var g = &grammar{ }, { name: "TableDelimiter", - pos: position{line: 2051, col: 1, offset: 75419}, + pos: position{line: 2136, col: 1, offset: 78074}, expr: &seqExpr{ - pos: position{line: 2051, col: 19, offset: 75437}, + pos: position{line: 2136, col: 19, offset: 78092}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2051, col: 19, offset: 75437}, + pos: position{line: 2136, col: 19, offset: 78092}, val: "|===", ignoreCase: false, want: "\"|===\"", }, &zeroOrMoreExpr{ - pos: position{line: 2051, col: 26, offset: 75444}, + pos: position{line: 2136, col: 26, offset: 78099}, expr: &ruleRefExpr{ - pos: position{line: 2051, col: 26, offset: 75444}, + pos: position{line: 2136, col: 26, offset: 78099}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2051, col: 33, offset: 75451}, + pos: position{line: 2136, col: 33, offset: 78106}, name: "EOL", }, }, @@ -14948,37 +14894,37 @@ var g = &grammar{ }, { name: "TableLineHeader", - pos: position{line: 2054, col: 1, offset: 75519}, + pos: position{line: 2139, col: 1, offset: 78174}, expr: &actionExpr{ - pos: position{line: 2054, col: 20, offset: 75538}, + pos: position{line: 2139, col: 20, offset: 78193}, run: (*parser).callonTableLineHeader1, expr: &seqExpr{ - pos: position{line: 2054, col: 20, offset: 75538}, + pos: position{line: 2139, col: 20, offset: 78193}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2054, col: 20, offset: 75538}, + pos: position{line: 2139, col: 20, offset: 78193}, expr: &ruleRefExpr{ - pos: position{line: 2054, col: 21, offset: 75539}, + pos: position{line: 2139, col: 21, offset: 78194}, name: "TableDelimiter", }, }, &labeledExpr{ - pos: position{line: 2054, col: 36, offset: 75554}, + pos: position{line: 2139, col: 36, offset: 78209}, label: "cells", expr: &oneOrMoreExpr{ - pos: position{line: 2054, col: 42, offset: 75560}, + pos: position{line: 2139, col: 42, offset: 78215}, expr: &ruleRefExpr{ - pos: position{line: 2054, col: 43, offset: 75561}, + pos: position{line: 2139, col: 43, offset: 78216}, name: "TableCell", }, }, }, &ruleRefExpr{ - pos: position{line: 2054, col: 55, offset: 75573}, + pos: position{line: 2139, col: 55, offset: 78228}, name: "EOL", }, &ruleRefExpr{ - pos: position{line: 2054, col: 59, offset: 75577}, + pos: position{line: 2139, col: 59, offset: 78232}, name: "BlankLine", }, }, @@ -14987,39 +14933,39 @@ var g = &grammar{ }, { name: "TableLine", - pos: position{line: 2058, col: 1, offset: 75645}, + pos: position{line: 2143, col: 1, offset: 78300}, expr: &actionExpr{ - pos: position{line: 2058, col: 14, offset: 75658}, + pos: position{line: 2143, col: 14, offset: 78313}, run: (*parser).callonTableLine1, expr: &seqExpr{ - pos: position{line: 2058, col: 14, offset: 75658}, + pos: position{line: 2143, col: 14, offset: 78313}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2058, col: 14, offset: 75658}, + pos: position{line: 2143, col: 14, offset: 78313}, expr: &ruleRefExpr{ - pos: position{line: 2058, col: 15, offset: 75659}, + pos: position{line: 2143, col: 15, offset: 78314}, name: "TableDelimiter", }, }, &labeledExpr{ - pos: position{line: 2058, col: 30, offset: 75674}, + pos: position{line: 2143, col: 30, offset: 78329}, label: "cells", expr: &oneOrMoreExpr{ - pos: position{line: 2058, col: 36, offset: 75680}, + pos: position{line: 2143, col: 36, offset: 78335}, expr: &ruleRefExpr{ - pos: position{line: 2058, col: 37, offset: 75681}, + pos: position{line: 2143, col: 37, offset: 78336}, name: "TableCell", }, }, }, &ruleRefExpr{ - pos: position{line: 2058, col: 49, offset: 75693}, + pos: position{line: 2143, col: 49, offset: 78348}, name: "EOL", }, &zeroOrMoreExpr{ - pos: position{line: 2058, col: 53, offset: 75697}, + pos: position{line: 2143, col: 53, offset: 78352}, expr: &ruleRefExpr{ - pos: position{line: 2058, col: 53, offset: 75697}, + pos: position{line: 2143, col: 53, offset: 78352}, name: "BlankLine", }, }, @@ -15029,54 +14975,54 @@ var g = &grammar{ }, { name: "TableCell", - pos: position{line: 2062, col: 1, offset: 75766}, + pos: position{line: 2147, col: 1, offset: 78421}, expr: &actionExpr{ - pos: position{line: 2062, col: 14, offset: 75779}, + pos: position{line: 2147, col: 14, offset: 78434}, run: (*parser).callonTableCell1, expr: &seqExpr{ - pos: position{line: 2062, col: 14, offset: 75779}, + pos: position{line: 2147, col: 14, offset: 78434}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 2062, col: 14, offset: 75779}, + pos: position{line: 2147, col: 14, offset: 78434}, name: "TableCellSeparator", }, &labeledExpr{ - pos: position{line: 2062, col: 33, offset: 75798}, + pos: position{line: 2147, col: 33, offset: 78453}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2062, col: 42, offset: 75807}, + pos: position{line: 2147, col: 42, offset: 78462}, expr: &seqExpr{ - pos: position{line: 2062, col: 43, offset: 75808}, + pos: position{line: 2147, col: 43, offset: 78463}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2062, col: 43, offset: 75808}, + pos: position{line: 2147, col: 43, offset: 78463}, expr: &ruleRefExpr{ - pos: position{line: 2062, col: 44, offset: 75809}, + pos: position{line: 2147, col: 44, offset: 78464}, name: "TableCellSeparator", }, }, ¬Expr{ - pos: position{line: 2062, col: 63, offset: 75828}, + pos: position{line: 2147, col: 63, offset: 78483}, expr: &ruleRefExpr{ - pos: position{line: 2062, col: 64, offset: 75829}, + pos: position{line: 2147, col: 64, offset: 78484}, name: "EOL", }, }, &zeroOrMoreExpr{ - pos: position{line: 2062, col: 68, offset: 75833}, + pos: position{line: 2147, col: 68, offset: 78488}, expr: &ruleRefExpr{ - pos: position{line: 2062, col: 68, offset: 75833}, + pos: position{line: 2147, col: 68, offset: 78488}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2062, col: 75, offset: 75840}, + pos: position{line: 2147, col: 75, offset: 78495}, name: "InlineElement", }, &zeroOrMoreExpr{ - pos: position{line: 2062, col: 89, offset: 75854}, + pos: position{line: 2147, col: 89, offset: 78509}, expr: &ruleRefExpr{ - pos: position{line: 2062, col: 89, offset: 75854}, + pos: position{line: 2147, col: 89, offset: 78509}, name: "Space", }, }, @@ -15090,25 +15036,25 @@ var g = &grammar{ }, { name: "CommentBlockDelimiter", - pos: position{line: 2069, col: 1, offset: 76103}, + pos: position{line: 2154, col: 1, offset: 78758}, expr: &seqExpr{ - pos: position{line: 2069, col: 26, offset: 76128}, + pos: position{line: 2154, col: 26, offset: 78783}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2069, col: 26, offset: 76128}, + pos: position{line: 2154, col: 26, offset: 78783}, val: "////", ignoreCase: false, want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 2069, col: 33, offset: 76135}, + pos: position{line: 2154, col: 33, offset: 78790}, expr: &ruleRefExpr{ - pos: position{line: 2069, col: 33, offset: 76135}, + pos: position{line: 2154, col: 33, offset: 78790}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2069, col: 40, offset: 76142}, + pos: position{line: 2154, col: 40, offset: 78797}, name: "EOL", }, }, @@ -15116,25 +15062,25 @@ var g = &grammar{ }, { name: "CommentBlockStartDelimiter", - pos: position{line: 2071, col: 1, offset: 76147}, + pos: position{line: 2156, col: 1, offset: 78802}, expr: &seqExpr{ - pos: position{line: 2071, col: 31, offset: 76177}, + pos: position{line: 2156, col: 31, offset: 78832}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2071, col: 31, offset: 76177}, + pos: position{line: 2156, col: 31, offset: 78832}, val: "////", ignoreCase: false, want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 2071, col: 38, offset: 76184}, + pos: position{line: 2156, col: 38, offset: 78839}, expr: &ruleRefExpr{ - pos: position{line: 2071, col: 38, offset: 76184}, + pos: position{line: 2156, col: 38, offset: 78839}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2071, col: 45, offset: 76191}, + pos: position{line: 2156, col: 45, offset: 78846}, name: "EOL", }, }, @@ -15142,34 +15088,34 @@ var g = &grammar{ }, { name: "CommentBlockEndDelimiter", - pos: position{line: 2073, col: 1, offset: 76196}, + pos: position{line: 2158, col: 1, offset: 78851}, expr: &choiceExpr{ - pos: position{line: 2073, col: 29, offset: 76224}, + pos: position{line: 2158, col: 29, offset: 78879}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 2073, col: 30, offset: 76225}, + pos: position{line: 2158, col: 30, offset: 78880}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2073, col: 30, offset: 76225}, + pos: position{line: 2158, col: 30, offset: 78880}, val: "////", ignoreCase: false, want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 2073, col: 37, offset: 76232}, + pos: position{line: 2158, col: 37, offset: 78887}, expr: &ruleRefExpr{ - pos: position{line: 2073, col: 37, offset: 76232}, + pos: position{line: 2158, col: 37, offset: 78887}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2073, col: 44, offset: 76239}, + pos: position{line: 2158, col: 44, offset: 78894}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 2073, col: 51, offset: 76246}, + pos: position{line: 2158, col: 51, offset: 78901}, name: "EOF", }, }, @@ -15177,27 +15123,27 @@ var g = &grammar{ }, { name: "CommentBlock", - pos: position{line: 2075, col: 1, offset: 76251}, + pos: position{line: 2160, col: 1, offset: 78906}, expr: &actionExpr{ - pos: position{line: 2075, col: 17, offset: 76267}, + pos: position{line: 2160, col: 17, offset: 78922}, run: (*parser).callonCommentBlock1, expr: &seqExpr{ - pos: position{line: 2075, col: 17, offset: 76267}, + pos: position{line: 2160, col: 17, offset: 78922}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 2075, col: 17, offset: 76267}, + pos: position{line: 2160, col: 17, offset: 78922}, name: "CommentBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 2075, col: 44, offset: 76294}, + pos: position{line: 2160, col: 44, offset: 78949}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 2075, col: 53, offset: 76303}, + pos: position{line: 2160, col: 53, offset: 78958}, name: "CommentBlockRawContent", }, }, &ruleRefExpr{ - pos: position{line: 2075, col: 78, offset: 76328}, + pos: position{line: 2160, col: 78, offset: 78983}, name: "CommentBlockEndDelimiter", }, }, @@ -15206,27 +15152,27 @@ var g = &grammar{ }, { name: "CommentBlockRawContent", - pos: position{line: 2079, col: 1, offset: 76438}, + pos: position{line: 2164, col: 1, offset: 79093}, expr: &zeroOrMoreExpr{ - pos: position{line: 2079, col: 27, offset: 76464}, + pos: position{line: 2164, col: 27, offset: 79119}, expr: &actionExpr{ - pos: position{line: 2079, col: 28, offset: 76465}, + pos: position{line: 2164, col: 28, offset: 79120}, run: (*parser).callonCommentBlockRawContent2, expr: &seqExpr{ - pos: position{line: 2079, col: 28, offset: 76465}, + pos: position{line: 2164, col: 28, offset: 79120}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2079, col: 28, offset: 76465}, + pos: position{line: 2164, col: 28, offset: 79120}, expr: &ruleRefExpr{ - pos: position{line: 2079, col: 29, offset: 76466}, + pos: position{line: 2164, col: 29, offset: 79121}, name: "CommentBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 2079, col: 54, offset: 76491}, + pos: position{line: 2164, col: 54, offset: 79146}, label: "line", expr: &ruleRefExpr{ - pos: position{line: 2079, col: 60, offset: 76497}, + pos: position{line: 2164, col: 60, offset: 79152}, name: "DelimitedBlockRawLine", }, }, @@ -15237,36 +15183,36 @@ var g = &grammar{ }, { name: "SingleLineComment", - pos: position{line: 2083, col: 1, offset: 76641}, + pos: position{line: 2168, col: 1, offset: 79296}, expr: &actionExpr{ - pos: position{line: 2083, col: 22, offset: 76662}, + pos: position{line: 2168, col: 22, offset: 79317}, run: (*parser).callonSingleLineComment1, expr: &seqExpr{ - pos: position{line: 2083, col: 22, offset: 76662}, + pos: position{line: 2168, col: 22, offset: 79317}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2083, col: 22, offset: 76662}, + pos: position{line: 2168, col: 22, offset: 79317}, expr: &ruleRefExpr{ - pos: position{line: 2083, col: 23, offset: 76663}, + pos: position{line: 2168, col: 23, offset: 79318}, name: "CommentBlockDelimiter", }, }, &litMatcher{ - pos: position{line: 2083, col: 45, offset: 76685}, + pos: position{line: 2168, col: 45, offset: 79340}, val: "//", ignoreCase: false, want: "\"//\"", }, &labeledExpr{ - pos: position{line: 2083, col: 50, offset: 76690}, + pos: position{line: 2168, col: 50, offset: 79345}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 2083, col: 59, offset: 76699}, + pos: position{line: 2168, col: 59, offset: 79354}, name: "SingleLineCommentContent", }, }, &ruleRefExpr{ - pos: position{line: 2083, col: 85, offset: 76725}, + pos: position{line: 2168, col: 85, offset: 79380}, name: "EOL", }, }, @@ -15275,14 +15221,14 @@ var g = &grammar{ }, { name: "SingleLineCommentContent", - pos: position{line: 2087, col: 1, offset: 76790}, + pos: position{line: 2172, col: 1, offset: 79445}, expr: &actionExpr{ - pos: position{line: 2087, col: 29, offset: 76818}, + pos: position{line: 2172, col: 29, offset: 79473}, run: (*parser).callonSingleLineCommentContent1, expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 29, offset: 76818}, + pos: position{line: 2172, col: 29, offset: 79473}, expr: &charClassMatcher{ - pos: position{line: 2087, col: 29, offset: 76818}, + pos: position{line: 2172, col: 29, offset: 79473}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -15293,20 +15239,20 @@ var g = &grammar{ }, { name: "LiteralBlock", - pos: position{line: 2095, col: 1, offset: 77131}, + pos: position{line: 2180, col: 1, offset: 79786}, expr: &choiceExpr{ - pos: position{line: 2095, col: 17, offset: 77147}, + pos: position{line: 2180, col: 17, offset: 79802}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2095, col: 17, offset: 77147}, + pos: position{line: 2180, col: 17, offset: 79802}, name: "ParagraphWithLiteralAttribute", }, &ruleRefExpr{ - pos: position{line: 2095, col: 49, offset: 77179}, + pos: position{line: 2180, col: 49, offset: 79834}, name: "ParagraphWithHeadingSpaces", }, &ruleRefExpr{ - pos: position{line: 2095, col: 78, offset: 77208}, + pos: position{line: 2180, col: 78, offset: 79863}, name: "ParagraphWithLiteralBlockDelimiter", }, }, @@ -15314,9 +15260,9 @@ var g = &grammar{ }, { name: "LiteralBlockDelimiter", - pos: position{line: 2097, col: 1, offset: 77244}, + pos: position{line: 2182, col: 1, offset: 79899}, expr: &litMatcher{ - pos: position{line: 2097, col: 26, offset: 77269}, + pos: position{line: 2182, col: 26, offset: 79924}, val: "....", ignoreCase: false, want: "\"....\"", @@ -15324,29 +15270,29 @@ var g = &grammar{ }, { name: "ParagraphWithHeadingSpaces", - pos: position{line: 2100, col: 1, offset: 77341}, + pos: position{line: 2185, col: 1, offset: 79996}, expr: &actionExpr{ - pos: position{line: 2100, col: 31, offset: 77371}, + pos: position{line: 2185, col: 31, offset: 80026}, run: (*parser).callonParagraphWithHeadingSpaces1, expr: &seqExpr{ - pos: position{line: 2100, col: 31, offset: 77371}, + pos: position{line: 2185, col: 31, offset: 80026}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2100, col: 31, offset: 77371}, + pos: position{line: 2185, col: 31, offset: 80026}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 2100, col: 42, offset: 77382}, + pos: position{line: 2185, col: 42, offset: 80037}, expr: &ruleRefExpr{ - pos: position{line: 2100, col: 43, offset: 77383}, + pos: position{line: 2185, col: 43, offset: 80038}, name: "Attributes", }, }, }, &labeledExpr{ - pos: position{line: 2100, col: 56, offset: 77396}, + pos: position{line: 2185, col: 56, offset: 80051}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 2100, col: 63, offset: 77403}, + pos: position{line: 2185, col: 63, offset: 80058}, name: "ParagraphWithHeadingSpacesLines", }, }, @@ -15356,33 +15302,33 @@ var g = &grammar{ }, { name: "ParagraphWithHeadingSpacesLines", - pos: position{line: 2105, col: 1, offset: 77633}, + pos: position{line: 2190, col: 1, offset: 80288}, expr: &actionExpr{ - pos: position{line: 2106, col: 5, offset: 77673}, + pos: position{line: 2191, col: 5, offset: 80328}, run: (*parser).callonParagraphWithHeadingSpacesLines1, expr: &seqExpr{ - pos: position{line: 2106, col: 5, offset: 77673}, + pos: position{line: 2191, col: 5, offset: 80328}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2106, col: 5, offset: 77673}, + pos: position{line: 2191, col: 5, offset: 80328}, label: "firstLine", expr: &actionExpr{ - pos: position{line: 2106, col: 16, offset: 77684}, + pos: position{line: 2191, col: 16, offset: 80339}, run: (*parser).callonParagraphWithHeadingSpacesLines4, expr: &seqExpr{ - pos: position{line: 2106, col: 16, offset: 77684}, + pos: position{line: 2191, col: 16, offset: 80339}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2106, col: 16, offset: 77684}, + pos: position{line: 2191, col: 16, offset: 80339}, expr: &ruleRefExpr{ - pos: position{line: 2106, col: 16, offset: 77684}, + pos: position{line: 2191, col: 16, offset: 80339}, name: "Space", }, }, &oneOrMoreExpr{ - pos: position{line: 2106, col: 23, offset: 77691}, + pos: position{line: 2191, col: 23, offset: 80346}, expr: &charClassMatcher{ - pos: position{line: 2106, col: 23, offset: 77691}, + pos: position{line: 2191, col: 23, offset: 80346}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -15394,37 +15340,37 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2108, col: 8, offset: 77744}, + pos: position{line: 2193, col: 8, offset: 80399}, name: "EOL", }, &labeledExpr{ - pos: position{line: 2109, col: 5, offset: 77807}, + pos: position{line: 2194, col: 5, offset: 80462}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 2109, col: 16, offset: 77818}, + pos: position{line: 2194, col: 16, offset: 80473}, expr: &actionExpr{ - pos: position{line: 2110, col: 9, offset: 77828}, + pos: position{line: 2195, col: 9, offset: 80483}, run: (*parser).callonParagraphWithHeadingSpacesLines13, expr: &seqExpr{ - pos: position{line: 2110, col: 9, offset: 77828}, + pos: position{line: 2195, col: 9, offset: 80483}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2110, col: 9, offset: 77828}, + pos: position{line: 2195, col: 9, offset: 80483}, expr: &ruleRefExpr{ - pos: position{line: 2110, col: 10, offset: 77829}, + pos: position{line: 2195, col: 10, offset: 80484}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 2111, col: 9, offset: 77848}, + pos: position{line: 2196, col: 9, offset: 80503}, label: "otherLine", expr: &actionExpr{ - pos: position{line: 2111, col: 20, offset: 77859}, + pos: position{line: 2196, col: 20, offset: 80514}, run: (*parser).callonParagraphWithHeadingSpacesLines18, expr: &oneOrMoreExpr{ - pos: position{line: 2111, col: 20, offset: 77859}, + pos: position{line: 2196, col: 20, offset: 80514}, expr: &charClassMatcher{ - pos: position{line: 2111, col: 20, offset: 77859}, + pos: position{line: 2196, col: 20, offset: 80514}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -15434,7 +15380,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2113, col: 12, offset: 77920}, + pos: position{line: 2198, col: 12, offset: 80575}, name: "EOL", }, }, @@ -15448,72 +15394,72 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiter", - pos: position{line: 2120, col: 1, offset: 78150}, + pos: position{line: 2205, col: 1, offset: 80805}, expr: &actionExpr{ - pos: position{line: 2120, col: 39, offset: 78188}, + pos: position{line: 2205, col: 39, offset: 80843}, run: (*parser).callonParagraphWithLiteralBlockDelimiter1, expr: &seqExpr{ - pos: position{line: 2120, col: 39, offset: 78188}, + pos: position{line: 2205, col: 39, offset: 80843}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2120, col: 39, offset: 78188}, + pos: position{line: 2205, col: 39, offset: 80843}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 2120, col: 50, offset: 78199}, + pos: position{line: 2205, col: 50, offset: 80854}, expr: &ruleRefExpr{ - pos: position{line: 2120, col: 51, offset: 78200}, + pos: position{line: 2205, col: 51, offset: 80855}, name: "Attributes", }, }, }, &ruleRefExpr{ - pos: position{line: 2121, col: 9, offset: 78221}, + pos: position{line: 2206, col: 9, offset: 80876}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 2121, col: 31, offset: 78243}, + pos: position{line: 2206, col: 31, offset: 80898}, expr: &ruleRefExpr{ - pos: position{line: 2121, col: 31, offset: 78243}, + pos: position{line: 2206, col: 31, offset: 80898}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2121, col: 38, offset: 78250}, + pos: position{line: 2206, col: 38, offset: 80905}, name: "Newline", }, &labeledExpr{ - pos: position{line: 2121, col: 46, offset: 78258}, + pos: position{line: 2206, col: 46, offset: 80913}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 2121, col: 53, offset: 78265}, + pos: position{line: 2206, col: 53, offset: 80920}, name: "ParagraphWithLiteralBlockDelimiterLines", }, }, &choiceExpr{ - pos: position{line: 2121, col: 95, offset: 78307}, + pos: position{line: 2206, col: 95, offset: 80962}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 2121, col: 96, offset: 78308}, + pos: position{line: 2206, col: 96, offset: 80963}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 2121, col: 96, offset: 78308}, + pos: position{line: 2206, col: 96, offset: 80963}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 2121, col: 118, offset: 78330}, + pos: position{line: 2206, col: 118, offset: 80985}, expr: &ruleRefExpr{ - pos: position{line: 2121, col: 118, offset: 78330}, + pos: position{line: 2206, col: 118, offset: 80985}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2121, col: 125, offset: 78337}, + pos: position{line: 2206, col: 125, offset: 80992}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 2121, col: 132, offset: 78344}, + pos: position{line: 2206, col: 132, offset: 80999}, name: "EOF", }, }, @@ -15524,17 +15470,17 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiterLines", - pos: position{line: 2126, col: 1, offset: 78503}, + pos: position{line: 2211, col: 1, offset: 81158}, expr: &actionExpr{ - pos: position{line: 2126, col: 44, offset: 78546}, + pos: position{line: 2211, col: 44, offset: 81201}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLines1, expr: &labeledExpr{ - pos: position{line: 2126, col: 44, offset: 78546}, + pos: position{line: 2211, col: 44, offset: 81201}, label: "lines", expr: &zeroOrMoreExpr{ - pos: position{line: 2126, col: 50, offset: 78552}, + pos: position{line: 2211, col: 50, offset: 81207}, expr: &ruleRefExpr{ - pos: position{line: 2126, col: 51, offset: 78553}, + pos: position{line: 2211, col: 51, offset: 81208}, name: "ParagraphWithLiteralBlockDelimiterLine", }, }, @@ -15543,33 +15489,33 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiterLine", - pos: position{line: 2130, col: 1, offset: 78637}, + pos: position{line: 2215, col: 1, offset: 81292}, expr: &actionExpr{ - pos: position{line: 2131, col: 5, offset: 78692}, + pos: position{line: 2216, col: 5, offset: 81347}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLine1, expr: &seqExpr{ - pos: position{line: 2131, col: 5, offset: 78692}, + pos: position{line: 2216, col: 5, offset: 81347}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2131, col: 5, offset: 78692}, + pos: position{line: 2216, col: 5, offset: 81347}, label: "line", expr: &actionExpr{ - pos: position{line: 2131, col: 11, offset: 78698}, + pos: position{line: 2216, col: 11, offset: 81353}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLine4, expr: &seqExpr{ - pos: position{line: 2131, col: 11, offset: 78698}, + pos: position{line: 2216, col: 11, offset: 81353}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2131, col: 11, offset: 78698}, + pos: position{line: 2216, col: 11, offset: 81353}, expr: &ruleRefExpr{ - pos: position{line: 2131, col: 12, offset: 78699}, + pos: position{line: 2216, col: 12, offset: 81354}, name: "LiteralBlockDelimiter", }, }, &zeroOrMoreExpr{ - pos: position{line: 2131, col: 34, offset: 78721}, + pos: position{line: 2216, col: 34, offset: 81376}, expr: &charClassMatcher{ - pos: position{line: 2131, col: 34, offset: 78721}, + pos: position{line: 2216, col: 34, offset: 81376}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -15581,7 +15527,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2133, col: 8, offset: 78774}, + pos: position{line: 2218, col: 8, offset: 81429}, name: "EOL", }, }, @@ -15590,33 +15536,33 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralAttribute", - pos: position{line: 2138, col: 1, offset: 78900}, + pos: position{line: 2223, col: 1, offset: 81555}, expr: &actionExpr{ - pos: position{line: 2139, col: 5, offset: 78938}, + pos: position{line: 2224, col: 5, offset: 81593}, run: (*parser).callonParagraphWithLiteralAttribute1, expr: &seqExpr{ - pos: position{line: 2139, col: 5, offset: 78938}, + pos: position{line: 2224, col: 5, offset: 81593}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2139, col: 5, offset: 78938}, + pos: position{line: 2224, col: 5, offset: 81593}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 2139, col: 16, offset: 78949}, + pos: position{line: 2224, col: 16, offset: 81604}, expr: &ruleRefExpr{ - pos: position{line: 2139, col: 17, offset: 78950}, + pos: position{line: 2224, col: 17, offset: 81605}, name: "Attributes", }, }, }, &andCodeExpr{ - pos: position{line: 2140, col: 5, offset: 78967}, + pos: position{line: 2225, col: 5, offset: 81622}, run: (*parser).callonParagraphWithLiteralAttribute6, }, &labeledExpr{ - pos: position{line: 2147, col: 5, offset: 79174}, + pos: position{line: 2232, col: 5, offset: 81829}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 2147, col: 12, offset: 79181}, + pos: position{line: 2232, col: 12, offset: 81836}, name: "ParagraphWithLiteralAttributeLines", }, }, @@ -15626,12 +15572,12 @@ var g = &grammar{ }, { name: "LiteralKind", - pos: position{line: 2151, col: 1, offset: 79331}, + pos: position{line: 2236, col: 1, offset: 81986}, expr: &actionExpr{ - pos: position{line: 2151, col: 16, offset: 79346}, + pos: position{line: 2236, col: 16, offset: 82001}, run: (*parser).callonLiteralKind1, expr: &litMatcher{ - pos: position{line: 2151, col: 16, offset: 79346}, + pos: position{line: 2236, col: 16, offset: 82001}, val: "literal", ignoreCase: false, want: "\"literal\"", @@ -15640,17 +15586,17 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralAttributeLines", - pos: position{line: 2156, col: 1, offset: 79429}, + pos: position{line: 2241, col: 1, offset: 82084}, expr: &actionExpr{ - pos: position{line: 2156, col: 39, offset: 79467}, + pos: position{line: 2241, col: 39, offset: 82122}, run: (*parser).callonParagraphWithLiteralAttributeLines1, expr: &labeledExpr{ - pos: position{line: 2156, col: 39, offset: 79467}, + pos: position{line: 2241, col: 39, offset: 82122}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 2156, col: 45, offset: 79473}, + pos: position{line: 2241, col: 45, offset: 82128}, expr: &ruleRefExpr{ - pos: position{line: 2156, col: 46, offset: 79474}, + pos: position{line: 2241, col: 46, offset: 82129}, name: "ParagraphWithLiteralAttributeLine", }, }, @@ -15659,30 +15605,30 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralAttributeLine", - pos: position{line: 2160, col: 1, offset: 79554}, + pos: position{line: 2245, col: 1, offset: 82209}, expr: &actionExpr{ - pos: position{line: 2160, col: 38, offset: 79591}, + pos: position{line: 2245, col: 38, offset: 82246}, run: (*parser).callonParagraphWithLiteralAttributeLine1, expr: &seqExpr{ - pos: position{line: 2160, col: 38, offset: 79591}, + pos: position{line: 2245, col: 38, offset: 82246}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2160, col: 38, offset: 79591}, + pos: position{line: 2245, col: 38, offset: 82246}, expr: &ruleRefExpr{ - pos: position{line: 2160, col: 39, offset: 79592}, + pos: position{line: 2245, col: 39, offset: 82247}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 2160, col: 49, offset: 79602}, + pos: position{line: 2245, col: 49, offset: 82257}, label: "content", expr: &actionExpr{ - pos: position{line: 2160, col: 58, offset: 79611}, + pos: position{line: 2245, col: 58, offset: 82266}, run: (*parser).callonParagraphWithLiteralAttributeLine6, expr: &oneOrMoreExpr{ - pos: position{line: 2160, col: 58, offset: 79611}, + pos: position{line: 2245, col: 58, offset: 82266}, expr: &charClassMatcher{ - pos: position{line: 2160, col: 58, offset: 79611}, + pos: position{line: 2245, col: 58, offset: 82266}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -15692,7 +15638,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2162, col: 4, offset: 79656}, + pos: position{line: 2247, col: 4, offset: 82311}, name: "EOL", }, }, @@ -15701,29 +15647,29 @@ var g = &grammar{ }, { name: "IndexTerm", - pos: position{line: 2169, col: 1, offset: 79842}, + pos: position{line: 2254, col: 1, offset: 82497}, expr: &actionExpr{ - pos: position{line: 2169, col: 14, offset: 79855}, + pos: position{line: 2254, col: 14, offset: 82510}, run: (*parser).callonIndexTerm1, expr: &seqExpr{ - pos: position{line: 2169, col: 14, offset: 79855}, + pos: position{line: 2254, col: 14, offset: 82510}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2169, col: 14, offset: 79855}, + pos: position{line: 2254, col: 14, offset: 82510}, val: "((", ignoreCase: false, want: "\"((\"", }, &labeledExpr{ - pos: position{line: 2169, col: 19, offset: 79860}, + pos: position{line: 2254, col: 19, offset: 82515}, label: "term", expr: &ruleRefExpr{ - pos: position{line: 2169, col: 25, offset: 79866}, + pos: position{line: 2254, col: 25, offset: 82521}, name: "IndexTermContent", }, }, &litMatcher{ - pos: position{line: 2169, col: 43, offset: 79884}, + pos: position{line: 2254, col: 43, offset: 82539}, val: "))", ignoreCase: false, want: "\"))\"", @@ -15734,55 +15680,59 @@ var g = &grammar{ }, { name: "IndexTermContent", - pos: position{line: 2173, col: 1, offset: 79949}, + pos: position{line: 2258, col: 1, offset: 82604}, expr: &actionExpr{ - pos: position{line: 2173, col: 21, offset: 79969}, + pos: position{line: 2258, col: 21, offset: 82624}, run: (*parser).callonIndexTermContent1, expr: &labeledExpr{ - pos: position{line: 2173, col: 21, offset: 79969}, + pos: position{line: 2258, col: 21, offset: 82624}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2173, col: 30, offset: 79978}, + pos: position{line: 2258, col: 30, offset: 82633}, expr: &choiceExpr{ - pos: position{line: 2173, col: 31, offset: 79979}, + pos: position{line: 2258, col: 31, offset: 82634}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2173, col: 31, offset: 79979}, + pos: position{line: 2258, col: 31, offset: 82634}, name: "Word", }, &ruleRefExpr{ - pos: position{line: 2173, col: 38, offset: 79986}, + pos: position{line: 2258, col: 38, offset: 82641}, name: "QuotedString", }, &ruleRefExpr{ - pos: position{line: 2173, col: 53, offset: 80001}, + pos: position{line: 2258, col: 53, offset: 82656}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 2173, col: 66, offset: 80014}, + pos: position{line: 2258, col: 66, offset: 82669}, name: "Space", }, &ruleRefExpr{ - pos: position{line: 2173, col: 74, offset: 80022}, + pos: position{line: 2258, col: 74, offset: 82677}, name: "SpecialCharacter", }, + &ruleRefExpr{ + pos: position{line: 2258, col: 93, offset: 82696}, + name: "ElementPlaceHolder", + }, &actionExpr{ - pos: position{line: 2173, col: 93, offset: 80041}, - run: (*parser).callonIndexTermContent10, + pos: position{line: 2258, col: 114, offset: 82717}, + run: (*parser).callonIndexTermContent11, expr: &seqExpr{ - pos: position{line: 2173, col: 94, offset: 80042}, + pos: position{line: 2258, col: 115, offset: 82718}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2173, col: 94, offset: 80042}, + pos: position{line: 2258, col: 115, offset: 82718}, expr: &litMatcher{ - pos: position{line: 2173, col: 95, offset: 80043}, + pos: position{line: 2258, col: 116, offset: 82719}, val: "))", ignoreCase: false, want: "\"))\"", }, }, &anyMatcher{ - line: 2173, col: 100, offset: 80048, + line: 2258, col: 121, offset: 82724, }, }, }, @@ -15795,63 +15745,63 @@ var g = &grammar{ }, { name: "ConcealedIndexTerm", - pos: position{line: 2179, col: 1, offset: 80154}, + pos: position{line: 2264, col: 1, offset: 82830}, expr: &actionExpr{ - pos: position{line: 2179, col: 23, offset: 80176}, + pos: position{line: 2264, col: 23, offset: 82852}, run: (*parser).callonConcealedIndexTerm1, expr: &seqExpr{ - pos: position{line: 2179, col: 23, offset: 80176}, + pos: position{line: 2264, col: 23, offset: 82852}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2179, col: 23, offset: 80176}, + pos: position{line: 2264, col: 23, offset: 82852}, val: "(((", ignoreCase: false, want: "\"(((\"", }, &labeledExpr{ - pos: position{line: 2179, col: 29, offset: 80182}, + pos: position{line: 2264, col: 29, offset: 82858}, label: "term1", expr: &ruleRefExpr{ - pos: position{line: 2179, col: 36, offset: 80189}, + pos: position{line: 2264, col: 36, offset: 82865}, name: "ConcealedIndexTermContent", }, }, &labeledExpr{ - pos: position{line: 2180, col: 5, offset: 80221}, + pos: position{line: 2265, col: 5, offset: 82897}, label: "term2", expr: &zeroOrOneExpr{ - pos: position{line: 2180, col: 11, offset: 80227}, + pos: position{line: 2265, col: 11, offset: 82903}, expr: &actionExpr{ - pos: position{line: 2180, col: 12, offset: 80228}, + pos: position{line: 2265, col: 12, offset: 82904}, run: (*parser).callonConcealedIndexTerm8, expr: &seqExpr{ - pos: position{line: 2180, col: 12, offset: 80228}, + pos: position{line: 2265, col: 12, offset: 82904}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 2180, col: 12, offset: 80228}, + pos: position{line: 2265, col: 12, offset: 82904}, expr: &ruleRefExpr{ - pos: position{line: 2180, col: 12, offset: 80228}, + pos: position{line: 2265, col: 12, offset: 82904}, name: "Space", }, }, &litMatcher{ - pos: position{line: 2180, col: 19, offset: 80235}, + pos: position{line: 2265, col: 19, offset: 82911}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 2180, col: 23, offset: 80239}, + pos: position{line: 2265, col: 23, offset: 82915}, expr: &ruleRefExpr{ - pos: position{line: 2180, col: 23, offset: 80239}, + pos: position{line: 2265, col: 23, offset: 82915}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 2180, col: 30, offset: 80246}, + pos: position{line: 2265, col: 30, offset: 82922}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 2180, col: 39, offset: 80255}, + pos: position{line: 2265, col: 39, offset: 82931}, name: "ConcealedIndexTermContent", }, }, @@ -15861,41 +15811,41 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 2181, col: 5, offset: 80313}, + pos: position{line: 2266, col: 5, offset: 82989}, label: "term3", expr: &zeroOrOneExpr{ - pos: position{line: 2181, col: 11, offset: 80319}, + pos: position{line: 2266, col: 11, offset: 82995}, expr: &actionExpr{ - pos: position{line: 2181, col: 12, offset: 80320}, + pos: position{line: 2266, col: 12, offset: 82996}, run: (*parser).callonConcealedIndexTerm19, expr: &seqExpr{ - pos: position{line: 2181, col: 12, offset: 80320}, + pos: position{line: 2266, col: 12, offset: 82996}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 2181, col: 12, offset: 80320}, + pos: position{line: 2266, col: 12, offset: 82996}, expr: &ruleRefExpr{ - pos: position{line: 2181, col: 12, offset: 80320}, + pos: position{line: 2266, col: 12, offset: 82996}, name: "Space", }, }, &litMatcher{ - pos: position{line: 2181, col: 19, offset: 80327}, + pos: position{line: 2266, col: 19, offset: 83003}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 2181, col: 23, offset: 80331}, + pos: position{line: 2266, col: 23, offset: 83007}, expr: &ruleRefExpr{ - pos: position{line: 2181, col: 23, offset: 80331}, + pos: position{line: 2266, col: 23, offset: 83007}, name: "Space", }, }, &labeledExpr{ - pos: position{line: 2181, col: 30, offset: 80338}, + pos: position{line: 2266, col: 30, offset: 83014}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 2181, col: 39, offset: 80347}, + pos: position{line: 2266, col: 39, offset: 83023}, name: "ConcealedIndexTermContent", }, }, @@ -15905,7 +15855,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 2182, col: 5, offset: 80405}, + pos: position{line: 2267, col: 5, offset: 83081}, val: ")))", ignoreCase: false, want: "\")))\"", @@ -15916,21 +15866,21 @@ var g = &grammar{ }, { name: "ConcealedIndexTermContent", - pos: position{line: 2186, col: 1, offset: 80484}, + pos: position{line: 2271, col: 1, offset: 83160}, expr: &actionExpr{ - pos: position{line: 2186, col: 30, offset: 80513}, + pos: position{line: 2271, col: 30, offset: 83189}, run: (*parser).callonConcealedIndexTermContent1, expr: &oneOrMoreExpr{ - pos: position{line: 2186, col: 30, offset: 80513}, + pos: position{line: 2271, col: 30, offset: 83189}, expr: &choiceExpr{ - pos: position{line: 2186, col: 31, offset: 80514}, + pos: position{line: 2271, col: 31, offset: 83190}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2186, col: 31, offset: 80514}, + pos: position{line: 2271, col: 31, offset: 83190}, name: "Alphanum", }, &ruleRefExpr{ - pos: position{line: 2186, col: 42, offset: 80525}, + pos: position{line: 2271, col: 42, offset: 83201}, name: "Space", }, }, @@ -15940,29 +15890,29 @@ var g = &grammar{ }, { name: "BlankLine", - pos: position{line: 2193, col: 1, offset: 80674}, + pos: position{line: 2278, col: 1, offset: 83350}, expr: &actionExpr{ - pos: position{line: 2193, col: 14, offset: 80687}, + pos: position{line: 2278, col: 14, offset: 83363}, run: (*parser).callonBlankLine1, expr: &seqExpr{ - pos: position{line: 2193, col: 14, offset: 80687}, + pos: position{line: 2278, col: 14, offset: 83363}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2193, col: 14, offset: 80687}, + pos: position{line: 2278, col: 14, offset: 83363}, expr: &ruleRefExpr{ - pos: position{line: 2193, col: 15, offset: 80688}, + pos: position{line: 2278, col: 15, offset: 83364}, name: "EOF", }, }, &zeroOrMoreExpr{ - pos: position{line: 2193, col: 19, offset: 80692}, + pos: position{line: 2278, col: 19, offset: 83368}, expr: &ruleRefExpr{ - pos: position{line: 2193, col: 19, offset: 80692}, + pos: position{line: 2278, col: 19, offset: 83368}, name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 2193, col: 26, offset: 80699}, + pos: position{line: 2278, col: 26, offset: 83375}, name: "EOL", }, }, @@ -15971,28 +15921,28 @@ var g = &grammar{ }, { name: "Symbol", - pos: position{line: 2201, col: 1, offset: 80844}, + pos: position{line: 2286, col: 1, offset: 83520}, expr: &choiceExpr{ - pos: position{line: 2201, col: 11, offset: 80854}, + pos: position{line: 2286, col: 11, offset: 83530}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2201, col: 11, offset: 80854}, + pos: position{line: 2286, col: 11, offset: 83530}, name: "Apostrophe", }, &ruleRefExpr{ - pos: position{line: 2201, col: 24, offset: 80867}, + pos: position{line: 2286, col: 24, offset: 83543}, name: "Copyright", }, &ruleRefExpr{ - pos: position{line: 2201, col: 36, offset: 80879}, + pos: position{line: 2286, col: 36, offset: 83555}, name: "Trademark", }, &ruleRefExpr{ - pos: position{line: 2201, col: 48, offset: 80891}, + pos: position{line: 2286, col: 48, offset: 83567}, name: "Registered", }, &ruleRefExpr{ - pos: position{line: 2201, col: 61, offset: 80904}, + pos: position{line: 2286, col: 61, offset: 83580}, name: "Ellipsis", }, }, @@ -16000,12 +15950,12 @@ var g = &grammar{ }, { name: "Apostrophe", - pos: position{line: 2203, col: 1, offset: 80914}, + pos: position{line: 2288, col: 1, offset: 83590}, expr: &actionExpr{ - pos: position{line: 2203, col: 15, offset: 80928}, + pos: position{line: 2288, col: 15, offset: 83604}, run: (*parser).callonApostrophe1, expr: &litMatcher{ - pos: position{line: 2203, col: 15, offset: 80928}, + pos: position{line: 2288, col: 15, offset: 83604}, val: "`'", ignoreCase: false, want: "\"`'\"", @@ -16014,12 +15964,12 @@ var g = &grammar{ }, { name: "Copyright", - pos: position{line: 2206, col: 1, offset: 80981}, + pos: position{line: 2291, col: 1, offset: 83657}, expr: &actionExpr{ - pos: position{line: 2206, col: 14, offset: 80994}, + pos: position{line: 2291, col: 14, offset: 83670}, run: (*parser).callonCopyright1, expr: &litMatcher{ - pos: position{line: 2206, col: 14, offset: 80994}, + pos: position{line: 2291, col: 14, offset: 83670}, val: "(C)", ignoreCase: false, want: "\"(C)\"", @@ -16028,12 +15978,12 @@ var g = &grammar{ }, { name: "Trademark", - pos: position{line: 2209, col: 1, offset: 81048}, + pos: position{line: 2294, col: 1, offset: 83724}, expr: &actionExpr{ - pos: position{line: 2209, col: 14, offset: 81061}, + pos: position{line: 2294, col: 14, offset: 83737}, run: (*parser).callonTrademark1, expr: &litMatcher{ - pos: position{line: 2209, col: 14, offset: 81061}, + pos: position{line: 2294, col: 14, offset: 83737}, val: "(TM)", ignoreCase: false, want: "\"(TM)\"", @@ -16042,12 +15992,12 @@ var g = &grammar{ }, { name: "Registered", - pos: position{line: 2212, col: 1, offset: 81116}, + pos: position{line: 2297, col: 1, offset: 83792}, expr: &actionExpr{ - pos: position{line: 2212, col: 15, offset: 81130}, + pos: position{line: 2297, col: 15, offset: 83806}, run: (*parser).callonRegistered1, expr: &litMatcher{ - pos: position{line: 2212, col: 15, offset: 81130}, + pos: position{line: 2297, col: 15, offset: 83806}, val: "(R)", ignoreCase: false, want: "\"(R)\"", @@ -16056,12 +16006,12 @@ var g = &grammar{ }, { name: "Ellipsis", - pos: position{line: 2215, col: 1, offset: 81184}, + pos: position{line: 2300, col: 1, offset: 83860}, expr: &actionExpr{ - pos: position{line: 2215, col: 13, offset: 81196}, + pos: position{line: 2300, col: 13, offset: 83872}, run: (*parser).callonEllipsis1, expr: &litMatcher{ - pos: position{line: 2215, col: 13, offset: 81196}, + pos: position{line: 2300, col: 13, offset: 83872}, val: "...", ignoreCase: false, want: "\"...\"", @@ -16070,27 +16020,27 @@ var g = &grammar{ }, { name: "ImpliedApostrophe", - pos: position{line: 2223, col: 1, offset: 81473}, + pos: position{line: 2308, col: 1, offset: 84149}, expr: &actionExpr{ - pos: position{line: 2223, col: 22, offset: 81494}, + pos: position{line: 2308, col: 22, offset: 84170}, run: (*parser).callonImpliedApostrophe1, expr: &seqExpr{ - pos: position{line: 2223, col: 22, offset: 81494}, + pos: position{line: 2308, col: 22, offset: 84170}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 2223, col: 22, offset: 81494}, + pos: position{line: 2308, col: 22, offset: 84170}, name: "Alphanum", }, &litMatcher{ - pos: position{line: 2223, col: 31, offset: 81503}, + pos: position{line: 2308, col: 31, offset: 84179}, val: "'", ignoreCase: false, want: "\"'\"", }, &andExpr{ - pos: position{line: 2223, col: 35, offset: 81507}, + pos: position{line: 2308, col: 35, offset: 84183}, expr: &charClassMatcher{ - pos: position{line: 2223, col: 36, offset: 81508}, + pos: position{line: 2308, col: 36, offset: 84184}, val: "[\\pL]", classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, @@ -16103,30 +16053,47 @@ var g = &grammar{ }, { name: "SpecialCharacter", - pos: position{line: 2232, col: 1, offset: 81870}, - expr: &actionExpr{ - pos: position{line: 2232, col: 21, offset: 81890}, - run: (*parser).callonSpecialCharacter1, - expr: &choiceExpr{ - pos: position{line: 2232, col: 22, offset: 81891}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2232, col: 22, offset: 81891}, - val: "<", - ignoreCase: false, - want: "\"<\"", - }, - &litMatcher{ - pos: position{line: 2232, col: 28, offset: 81897}, - val: ">", - ignoreCase: false, - want: "\">\"", + pos: position{line: 2317, col: 1, offset: 84546}, + expr: &choiceExpr{ + pos: position{line: 2317, col: 21, offset: 84566}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2317, col: 21, offset: 84566}, + name: "InternalCrossReference", + }, + &actionExpr{ + pos: position{line: 2317, col: 46, offset: 84591}, + run: (*parser).callonSpecialCharacter3, + expr: &ruleRefExpr{ + pos: position{line: 2317, col: 46, offset: 84591}, + name: "Callout", }, - &litMatcher{ - pos: position{line: 2232, col: 34, offset: 81903}, - val: "&", - ignoreCase: false, - want: "\"&\"", + }, + &actionExpr{ + pos: position{line: 2320, col: 9, offset: 84753}, + run: (*parser).callonSpecialCharacter5, + expr: &choiceExpr{ + pos: position{line: 2320, col: 10, offset: 84754}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2320, col: 10, offset: 84754}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &litMatcher{ + pos: position{line: 2320, col: 16, offset: 84760}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &litMatcher{ + pos: position{line: 2320, col: 22, offset: 84766}, + val: "&", + ignoreCase: false, + want: "\"&\"", + }, + }, }, }, }, @@ -16134,9 +16101,9 @@ var g = &grammar{ }, { name: "Alphanum", - pos: position{line: 2239, col: 1, offset: 82073}, + pos: position{line: 2327, col: 1, offset: 84944}, expr: &charClassMatcher{ - pos: position{line: 2239, col: 13, offset: 82085}, + pos: position{line: 2327, col: 13, offset: 84956}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -16146,42 +16113,42 @@ var g = &grammar{ }, { name: "Parenthesis", - pos: position{line: 2241, col: 1, offset: 82095}, + pos: position{line: 2329, col: 1, offset: 84966}, expr: &choiceExpr{ - pos: position{line: 2241, col: 16, offset: 82110}, + pos: position{line: 2329, col: 16, offset: 84981}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2241, col: 16, offset: 82110}, + pos: position{line: 2329, col: 16, offset: 84981}, val: "(", ignoreCase: false, want: "\"(\"", }, &litMatcher{ - pos: position{line: 2241, col: 22, offset: 82116}, + pos: position{line: 2329, col: 22, offset: 84987}, val: ")", ignoreCase: false, want: "\")\"", }, &litMatcher{ - pos: position{line: 2241, col: 28, offset: 82122}, + pos: position{line: 2329, col: 28, offset: 84993}, val: "[", ignoreCase: false, want: "\"[\"", }, &litMatcher{ - pos: position{line: 2241, col: 34, offset: 82128}, + pos: position{line: 2329, col: 34, offset: 84999}, val: "]", ignoreCase: false, want: "\"]\"", }, &litMatcher{ - pos: position{line: 2241, col: 40, offset: 82134}, + pos: position{line: 2329, col: 40, offset: 85005}, val: "{", ignoreCase: false, want: "\"{\"", }, &litMatcher{ - pos: position{line: 2241, col: 46, offset: 82140}, + pos: position{line: 2329, col: 46, offset: 85011}, val: "}", ignoreCase: false, want: "\"}\"", @@ -16191,14 +16158,14 @@ var g = &grammar{ }, { name: "Alphanums", - pos: position{line: 2243, col: 1, offset: 82146}, + pos: position{line: 2331, col: 1, offset: 85017}, expr: &actionExpr{ - pos: position{line: 2243, col: 14, offset: 82159}, + pos: position{line: 2331, col: 14, offset: 85030}, run: (*parser).callonAlphanums1, expr: &oneOrMoreExpr{ - pos: position{line: 2243, col: 14, offset: 82159}, + pos: position{line: 2331, col: 14, offset: 85030}, expr: &charClassMatcher{ - pos: position{line: 2243, col: 14, offset: 82159}, + pos: position{line: 2331, col: 14, offset: 85030}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -16210,20 +16177,20 @@ var g = &grammar{ }, { name: "Word", - pos: position{line: 2247, col: 1, offset: 82205}, + pos: position{line: 2335, col: 1, offset: 85076}, expr: &choiceExpr{ - pos: position{line: 2251, col: 5, offset: 82532}, + pos: position{line: 2339, col: 5, offset: 85403}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2251, col: 5, offset: 82532}, + pos: position{line: 2339, col: 5, offset: 85403}, run: (*parser).callonWord2, expr: &seqExpr{ - pos: position{line: 2251, col: 5, offset: 82532}, + pos: position{line: 2339, col: 5, offset: 85403}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2251, col: 5, offset: 82532}, + pos: position{line: 2339, col: 5, offset: 85403}, expr: &charClassMatcher{ - pos: position{line: 2251, col: 5, offset: 82532}, + pos: position{line: 2339, col: 5, offset: 85403}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -16232,19 +16199,19 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 2251, col: 15, offset: 82542}, + pos: position{line: 2339, col: 15, offset: 85413}, expr: &choiceExpr{ - pos: position{line: 2251, col: 17, offset: 82544}, + pos: position{line: 2339, col: 17, offset: 85415}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 2251, col: 17, offset: 82544}, + pos: position{line: 2339, col: 17, offset: 85415}, val: "[\\r\\n ,\\]]", chars: []rune{'\r', '\n', ' ', ',', ']'}, ignoreCase: false, inverted: false, }, &ruleRefExpr{ - pos: position{line: 2251, col: 30, offset: 82557}, + pos: position{line: 2339, col: 30, offset: 85428}, name: "EOF", }, }, @@ -16254,15 +16221,15 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2253, col: 9, offset: 82627}, + pos: position{line: 2341, col: 9, offset: 85498}, run: (*parser).callonWord10, expr: &seqExpr{ - pos: position{line: 2253, col: 9, offset: 82627}, + pos: position{line: 2341, col: 9, offset: 85498}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2253, col: 9, offset: 82627}, + pos: position{line: 2341, col: 9, offset: 85498}, expr: &charClassMatcher{ - pos: position{line: 2253, col: 9, offset: 82627}, + pos: position{line: 2341, col: 9, offset: 85498}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -16271,21 +16238,21 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 2253, col: 19, offset: 82637}, + pos: position{line: 2341, col: 19, offset: 85508}, expr: &seqExpr{ - pos: position{line: 2253, col: 20, offset: 82638}, + pos: position{line: 2341, col: 20, offset: 85509}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2253, col: 20, offset: 82638}, + pos: position{line: 2341, col: 20, offset: 85509}, val: "[=*_`]", chars: []rune{'=', '*', '_', '`'}, ignoreCase: false, inverted: false, }, &oneOrMoreExpr{ - pos: position{line: 2253, col: 27, offset: 82645}, + pos: position{line: 2341, col: 27, offset: 85516}, expr: &charClassMatcher{ - pos: position{line: 2253, col: 27, offset: 82645}, + pos: position{line: 2341, col: 27, offset: 85516}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -16304,20 +16271,20 @@ var g = &grammar{ }, { name: "InlineWord", - pos: position{line: 2257, col: 1, offset: 82721}, + pos: position{line: 2345, col: 1, offset: 85592}, expr: &choiceExpr{ - pos: position{line: 2258, col: 5, offset: 82802}, + pos: position{line: 2346, col: 5, offset: 85673}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2258, col: 5, offset: 82802}, + pos: position{line: 2346, col: 5, offset: 85673}, run: (*parser).callonInlineWord2, expr: &seqExpr{ - pos: position{line: 2258, col: 5, offset: 82802}, + pos: position{line: 2346, col: 5, offset: 85673}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2258, col: 5, offset: 82802}, + pos: position{line: 2346, col: 5, offset: 85673}, expr: &charClassMatcher{ - pos: position{line: 2258, col: 5, offset: 82802}, + pos: position{line: 2346, col: 5, offset: 85673}, val: "[\\pL0-9,?!;]", chars: []rune{',', '?', '!', ';'}, ranges: []rune{'0', '9'}, @@ -16327,19 +16294,19 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 2258, col: 19, offset: 82816}, + pos: position{line: 2346, col: 19, offset: 85687}, expr: &choiceExpr{ - pos: position{line: 2258, col: 21, offset: 82818}, + pos: position{line: 2346, col: 21, offset: 85689}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 2258, col: 21, offset: 82818}, + pos: position{line: 2346, col: 21, offset: 85689}, val: "[\\r\\n ]", chars: []rune{'\r', '\n', ' '}, ignoreCase: false, inverted: false, }, &ruleRefExpr{ - pos: position{line: 2258, col: 31, offset: 82828}, + pos: position{line: 2346, col: 31, offset: 85699}, name: "EOF", }, }, @@ -16349,7 +16316,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 2260, col: 9, offset: 82897}, + pos: position{line: 2348, col: 9, offset: 85768}, name: "Word", }, }, @@ -16357,12 +16324,12 @@ var g = &grammar{ }, { name: "AnyChar", - pos: position{line: 2263, col: 1, offset: 82997}, + pos: position{line: 2351, col: 1, offset: 85868}, expr: &actionExpr{ - pos: position{line: 2263, col: 12, offset: 83008}, + pos: position{line: 2351, col: 12, offset: 85879}, run: (*parser).callonAnyChar1, expr: &charClassMatcher{ - pos: position{line: 2263, col: 12, offset: 83008}, + pos: position{line: 2351, col: 12, offset: 85879}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -16372,25 +16339,25 @@ var g = &grammar{ }, { name: "FileLocation", - pos: position{line: 2267, col: 1, offset: 83073}, + pos: position{line: 2355, col: 1, offset: 85944}, expr: &actionExpr{ - pos: position{line: 2267, col: 17, offset: 83089}, + pos: position{line: 2355, col: 17, offset: 85960}, run: (*parser).callonFileLocation1, expr: &labeledExpr{ - pos: position{line: 2267, col: 17, offset: 83089}, + pos: position{line: 2355, col: 17, offset: 85960}, label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 2267, col: 22, offset: 83094}, + pos: position{line: 2355, col: 22, offset: 85965}, expr: &choiceExpr{ - pos: position{line: 2267, col: 23, offset: 83095}, + pos: position{line: 2355, col: 23, offset: 85966}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2267, col: 23, offset: 83095}, + pos: position{line: 2355, col: 23, offset: 85966}, name: "FILENAME", }, &ruleRefExpr{ - pos: position{line: 2267, col: 34, offset: 83106}, - name: "AttributeSubstitution", + pos: position{line: 2355, col: 34, offset: 85977}, + name: "ElementPlaceHolder", }, }, }, @@ -16400,17 +16367,17 @@ var g = &grammar{ }, { name: "ResolvedFileLocation", - pos: position{line: 2271, col: 1, offset: 83190}, + pos: position{line: 2359, col: 1, offset: 86058}, expr: &actionExpr{ - pos: position{line: 2271, col: 25, offset: 83214}, + pos: position{line: 2359, col: 25, offset: 86082}, run: (*parser).callonResolvedFileLocation1, expr: &labeledExpr{ - pos: position{line: 2271, col: 25, offset: 83214}, + pos: position{line: 2359, col: 25, offset: 86082}, label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 2271, col: 30, offset: 83219}, + pos: position{line: 2359, col: 30, offset: 86087}, expr: &charClassMatcher{ - pos: position{line: 2271, col: 31, offset: 83220}, + pos: position{line: 2359, col: 31, offset: 86088}, val: "[^\\r\\n []", chars: []rune{'\r', '\n', ' ', '['}, ignoreCase: false, @@ -16422,39 +16389,39 @@ var g = &grammar{ }, { name: "Location", - pos: position{line: 2275, col: 1, offset: 83292}, + pos: position{line: 2363, col: 1, offset: 86160}, expr: &actionExpr{ - pos: position{line: 2275, col: 13, offset: 83304}, + pos: position{line: 2363, col: 13, offset: 86172}, run: (*parser).callonLocation1, expr: &seqExpr{ - pos: position{line: 2275, col: 13, offset: 83304}, + pos: position{line: 2363, col: 13, offset: 86172}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2275, col: 13, offset: 83304}, + pos: position{line: 2363, col: 13, offset: 86172}, label: "scheme", expr: &zeroOrOneExpr{ - pos: position{line: 2275, col: 20, offset: 83311}, + pos: position{line: 2363, col: 20, offset: 86179}, expr: &ruleRefExpr{ - pos: position{line: 2275, col: 21, offset: 83312}, + pos: position{line: 2363, col: 21, offset: 86180}, name: "URL_SCHEME", }, }, }, &labeledExpr{ - pos: position{line: 2275, col: 34, offset: 83325}, + pos: position{line: 2363, col: 34, offset: 86193}, label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 2275, col: 39, offset: 83330}, + pos: position{line: 2363, col: 39, offset: 86198}, expr: &choiceExpr{ - pos: position{line: 2275, col: 40, offset: 83331}, + pos: position{line: 2363, col: 40, offset: 86199}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2275, col: 40, offset: 83331}, + pos: position{line: 2363, col: 40, offset: 86199}, name: "FILENAME", }, &ruleRefExpr{ - pos: position{line: 2275, col: 51, offset: 83342}, - name: "AttributeSubstitution", + pos: position{line: 2363, col: 52, offset: 86211}, + name: "ElementPlaceHolder", }, }, }, @@ -16466,36 +16433,36 @@ var g = &grammar{ }, { name: "LocationWithScheme", - pos: position{line: 2279, col: 1, offset: 83430}, + pos: position{line: 2367, col: 1, offset: 86296}, expr: &actionExpr{ - pos: position{line: 2279, col: 23, offset: 83452}, + pos: position{line: 2367, col: 23, offset: 86318}, run: (*parser).callonLocationWithScheme1, expr: &seqExpr{ - pos: position{line: 2279, col: 23, offset: 83452}, + pos: position{line: 2367, col: 23, offset: 86318}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2279, col: 23, offset: 83452}, + pos: position{line: 2367, col: 23, offset: 86318}, label: "scheme", expr: &ruleRefExpr{ - pos: position{line: 2279, col: 31, offset: 83460}, + pos: position{line: 2367, col: 31, offset: 86326}, name: "URL_SCHEME", }, }, &labeledExpr{ - pos: position{line: 2279, col: 43, offset: 83472}, + pos: position{line: 2367, col: 43, offset: 86338}, label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 2279, col: 48, offset: 83477}, + pos: position{line: 2367, col: 48, offset: 86343}, expr: &choiceExpr{ - pos: position{line: 2279, col: 49, offset: 83478}, + pos: position{line: 2367, col: 49, offset: 86344}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2279, col: 49, offset: 83478}, + pos: position{line: 2367, col: 49, offset: 86344}, name: "FILENAME", }, &ruleRefExpr{ - pos: position{line: 2279, col: 60, offset: 83489}, - name: "AttributeSubstitution", + pos: position{line: 2367, col: 60, offset: 86355}, + name: "ElementPlaceHolder", }, }, }, @@ -16507,13 +16474,13 @@ var g = &grammar{ }, { name: "FILENAME", - pos: position{line: 2283, col: 1, offset: 83577}, + pos: position{line: 2371, col: 1, offset: 86440}, expr: &oneOrMoreExpr{ - pos: position{line: 2283, col: 13, offset: 83589}, + pos: position{line: 2371, col: 13, offset: 86452}, expr: &charClassMatcher{ - pos: position{line: 2283, col: 14, offset: 83590}, - val: "[^\\r\\n{}[\\] ]", - chars: []rune{'\r', '\n', '{', '}', '[', ']', ' '}, + pos: position{line: 2371, col: 14, offset: 86453}, + val: "[^\\r\\n[\\]\\uFFFD ]", + chars: []rune{'\r', '\n', '[', ']', '�', ' '}, ignoreCase: false, inverted: true, }, @@ -16521,26 +16488,26 @@ var g = &grammar{ }, { name: "ResolvedLocation", - pos: position{line: 2285, col: 1, offset: 83724}, + pos: position{line: 2373, col: 1, offset: 86521}, expr: &actionExpr{ - pos: position{line: 2285, col: 21, offset: 83744}, + pos: position{line: 2373, col: 21, offset: 86541}, run: (*parser).callonResolvedLocation1, expr: &seqExpr{ - pos: position{line: 2285, col: 21, offset: 83744}, + pos: position{line: 2373, col: 21, offset: 86541}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 2285, col: 21, offset: 83744}, + pos: position{line: 2373, col: 21, offset: 86541}, label: "scheme", expr: &ruleRefExpr{ - pos: position{line: 2285, col: 29, offset: 83752}, + pos: position{line: 2373, col: 29, offset: 86549}, name: "URL_SCHEME", }, }, &labeledExpr{ - pos: position{line: 2285, col: 41, offset: 83764}, + pos: position{line: 2373, col: 41, offset: 86561}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 2285, col: 47, offset: 83770}, + pos: position{line: 2373, col: 47, offset: 86567}, name: "RESOLVED_FILENAME", }, }, @@ -16550,11 +16517,11 @@ var g = &grammar{ }, { name: "RESOLVED_FILENAME", - pos: position{line: 2290, col: 1, offset: 84018}, + pos: position{line: 2378, col: 1, offset: 86815}, expr: &oneOrMoreExpr{ - pos: position{line: 2290, col: 22, offset: 84039}, + pos: position{line: 2378, col: 22, offset: 86836}, expr: &charClassMatcher{ - pos: position{line: 2290, col: 23, offset: 84040}, + pos: position{line: 2378, col: 23, offset: 86837}, val: "[^\\r\\n[\\] ]", chars: []rune{'\r', '\n', '[', ']', ' '}, ignoreCase: false, @@ -16564,14 +16531,14 @@ var g = &grammar{ }, { name: "URL", - pos: position{line: 2292, col: 1, offset: 84172}, + pos: position{line: 2380, col: 1, offset: 86969}, expr: &actionExpr{ - pos: position{line: 2292, col: 9, offset: 84180}, + pos: position{line: 2380, col: 9, offset: 86977}, run: (*parser).callonURL1, expr: &oneOrMoreExpr{ - pos: position{line: 2292, col: 9, offset: 84180}, + pos: position{line: 2380, col: 9, offset: 86977}, expr: &charClassMatcher{ - pos: position{line: 2292, col: 9, offset: 84180}, + pos: position{line: 2380, col: 9, offset: 86977}, val: "[^\\r\\n[\\]]", chars: []rune{'\r', '\n', '[', ']'}, ignoreCase: false, @@ -16582,36 +16549,36 @@ var g = &grammar{ }, { name: "URL_SCHEME", - pos: position{line: 2296, col: 1, offset: 84228}, + pos: position{line: 2384, col: 1, offset: 87025}, expr: &choiceExpr{ - pos: position{line: 2296, col: 15, offset: 84242}, + pos: position{line: 2384, col: 15, offset: 87039}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2296, col: 15, offset: 84242}, + pos: position{line: 2384, col: 15, offset: 87039}, val: "http://", ignoreCase: false, want: "\"http://\"", }, &litMatcher{ - pos: position{line: 2296, col: 27, offset: 84254}, + pos: position{line: 2384, col: 27, offset: 87051}, val: "https://", ignoreCase: false, want: "\"https://\"", }, &litMatcher{ - pos: position{line: 2296, col: 40, offset: 84267}, + pos: position{line: 2384, col: 40, offset: 87064}, val: "ftp://", ignoreCase: false, want: "\"ftp://\"", }, &litMatcher{ - pos: position{line: 2296, col: 51, offset: 84278}, + pos: position{line: 2384, col: 51, offset: 87075}, val: "irc://", ignoreCase: false, want: "\"irc://\"", }, &litMatcher{ - pos: position{line: 2296, col: 62, offset: 84289}, + pos: position{line: 2384, col: 62, offset: 87086}, val: "mailto:", ignoreCase: false, want: "\"mailto:\"", @@ -16621,14 +16588,14 @@ var g = &grammar{ }, { name: "ID", - pos: position{line: 2298, col: 1, offset: 84300}, + pos: position{line: 2386, col: 1, offset: 87097}, expr: &actionExpr{ - pos: position{line: 2298, col: 7, offset: 84306}, + pos: position{line: 2386, col: 7, offset: 87103}, run: (*parser).callonID1, expr: &oneOrMoreExpr{ - pos: position{line: 2298, col: 7, offset: 84306}, + pos: position{line: 2386, col: 7, offset: 87103}, expr: &charClassMatcher{ - pos: position{line: 2298, col: 7, offset: 84306}, + pos: position{line: 2386, col: 7, offset: 87103}, val: "[^[\\]<>,]", chars: []rune{'[', ']', '<', '>', ','}, ignoreCase: false, @@ -16639,12 +16606,12 @@ var g = &grammar{ }, { name: "DIGIT", - pos: position{line: 2302, col: 1, offset: 84431}, + pos: position{line: 2390, col: 1, offset: 87228}, expr: &actionExpr{ - pos: position{line: 2302, col: 10, offset: 84440}, + pos: position{line: 2390, col: 10, offset: 87237}, run: (*parser).callonDIGIT1, expr: &charClassMatcher{ - pos: position{line: 2302, col: 10, offset: 84440}, + pos: position{line: 2390, col: 10, offset: 87237}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -16654,26 +16621,26 @@ var g = &grammar{ }, { name: "NUMBER", - pos: position{line: 2306, col: 1, offset: 84482}, + pos: position{line: 2394, col: 1, offset: 87279}, expr: &actionExpr{ - pos: position{line: 2306, col: 11, offset: 84492}, + pos: position{line: 2394, col: 11, offset: 87289}, run: (*parser).callonNUMBER1, expr: &seqExpr{ - pos: position{line: 2306, col: 11, offset: 84492}, + pos: position{line: 2394, col: 11, offset: 87289}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 2306, col: 11, offset: 84492}, + pos: position{line: 2394, col: 11, offset: 87289}, expr: &litMatcher{ - pos: position{line: 2306, col: 11, offset: 84492}, + pos: position{line: 2394, col: 11, offset: 87289}, val: "-", ignoreCase: false, want: "\"-\"", }, }, &oneOrMoreExpr{ - pos: position{line: 2306, col: 16, offset: 84497}, + pos: position{line: 2394, col: 16, offset: 87294}, expr: &ruleRefExpr{ - pos: position{line: 2306, col: 16, offset: 84497}, + pos: position{line: 2394, col: 16, offset: 87294}, name: "DIGIT", }, }, @@ -16683,21 +16650,21 @@ var g = &grammar{ }, { name: "Space", - pos: position{line: 2310, col: 1, offset: 84549}, + pos: position{line: 2398, col: 1, offset: 87346}, expr: &choiceExpr{ - pos: position{line: 2310, col: 10, offset: 84558}, + pos: position{line: 2398, col: 10, offset: 87355}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2310, col: 10, offset: 84558}, + pos: position{line: 2398, col: 10, offset: 87355}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2310, col: 16, offset: 84564}, + pos: position{line: 2398, col: 16, offset: 87361}, run: (*parser).callonSpace3, expr: &litMatcher{ - pos: position{line: 2310, col: 16, offset: 84564}, + pos: position{line: 2398, col: 16, offset: 87361}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -16708,24 +16675,24 @@ var g = &grammar{ }, { name: "Newline", - pos: position{line: 2314, col: 1, offset: 84605}, + pos: position{line: 2402, col: 1, offset: 87402}, expr: &choiceExpr{ - pos: position{line: 2314, col: 12, offset: 84616}, + pos: position{line: 2402, col: 12, offset: 87413}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2314, col: 12, offset: 84616}, + pos: position{line: 2402, col: 12, offset: 87413}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, &litMatcher{ - pos: position{line: 2314, col: 21, offset: 84625}, + pos: position{line: 2402, col: 21, offset: 87422}, val: "\r", ignoreCase: false, want: "\"\\r\"", }, &litMatcher{ - pos: position{line: 2314, col: 28, offset: 84632}, + pos: position{line: 2402, col: 28, offset: 87429}, val: "\n", ignoreCase: false, want: "\"\\n\"", @@ -16735,26 +16702,26 @@ var g = &grammar{ }, { name: "EOF", - pos: position{line: 2316, col: 1, offset: 84638}, + pos: position{line: 2404, col: 1, offset: 87435}, expr: ¬Expr{ - pos: position{line: 2316, col: 8, offset: 84645}, + pos: position{line: 2404, col: 8, offset: 87442}, expr: &anyMatcher{ - line: 2316, col: 9, offset: 84646, + line: 2404, col: 9, offset: 87443, }, }, }, { name: "EOL", - pos: position{line: 2318, col: 1, offset: 84649}, + pos: position{line: 2406, col: 1, offset: 87446}, expr: &choiceExpr{ - pos: position{line: 2318, col: 8, offset: 84656}, + pos: position{line: 2406, col: 8, offset: 87453}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 2318, col: 8, offset: 84656}, + pos: position{line: 2406, col: 8, offset: 87453}, name: "Newline", }, &ruleRefExpr{ - pos: position{line: 2318, col: 18, offset: 84666}, + pos: position{line: 2406, col: 18, offset: 87463}, name: "EOF", }, }, @@ -17173,7 +17140,7 @@ func (p *parser) callonElementAttribute1() (interface{}, error) { } func (c *current) onElementID1(id interface{}) (interface{}, error) { - return types.NewElementID(id.(string)) + return types.NewElementID(id) } func (p *parser) callonElementID1() (interface{}, error) { @@ -17235,7 +17202,7 @@ func (p *parser) callonBlockAttrList1() (interface{}, error) { } func (c *current) onBlockAttrStyle1(style interface{}) (interface{}, error) { - return types.NewElementStyle(style.(string)) + return types.NewElementStyle(style) } func (p *parser) callonBlockAttrStyle1() (interface{}, error) { @@ -17246,7 +17213,7 @@ func (p *parser) callonBlockAttrStyle1() (interface{}, error) { func (c *current) onBlockAttrPositional21(value interface{}) (interface{}, error) { if value != nil { - return types.NewElementNamedAttr(types.AttrPositional2, value.(string)) + return types.NewElementNamedAttr(types.AttrPositional2, value) } return nil, nil } @@ -17259,7 +17226,7 @@ func (p *parser) callonBlockAttrPositional21() (interface{}, error) { func (c *current) onBlockAttrPositional31(value interface{}) (interface{}, error) { if value != nil { - return types.NewElementNamedAttr(types.AttrPositional3, value.(string)) + return types.NewElementNamedAttr(types.AttrPositional3, value) } return nil, nil } @@ -17435,7 +17402,7 @@ func (p *parser) callonQuotedTextAttrs1() (interface{}, error) { } func (c *current) onQuotedTextAttrRole1(role interface{}) (interface{}, error) { - return types.NewElementRole(role.(string)) + return types.NewElementRole(role) } func (p *parser) callonQuotedTextAttrRole1() (interface{}, error) { @@ -17456,7 +17423,7 @@ func (p *parser) callonStandaloneAttributes1() (interface{}, error) { } func (c *current) onShortHandAttrOption1(option interface{}) (interface{}, error) { - return types.NewElementOption(option.(string)) + return types.NewElementOption(option) } func (p *parser) callonShortHandAttrOption1() (interface{}, error) { @@ -17466,7 +17433,7 @@ func (p *parser) callonShortHandAttrOption1() (interface{}, error) { } func (c *current) onShortHandAttrID1(id interface{}) (interface{}, error) { - return types.NewElementID(id.(string)) + return types.NewElementID(id) } func (p *parser) callonShortHandAttrID1() (interface{}, error) { @@ -17476,7 +17443,7 @@ func (p *parser) callonShortHandAttrID1() (interface{}, error) { } func (c *current) onShortHandAttrRole1(role interface{}) (interface{}, error) { - return types.NewElementRole(role.(string)) + return types.NewElementRole(role) } func (p *parser) callonShortHandAttrRole1() (interface{}, error) { @@ -17486,7 +17453,7 @@ func (p *parser) callonShortHandAttrRole1() (interface{}, error) { } func (c *current) onPositionalValue1(value interface{}) (interface{}, error) { - return value.(string), nil + return value, nil } func (p *parser) callonPositionalValue1() (interface{}, error) { @@ -17572,187 +17539,156 @@ func (c *current) onAttrValDQin1(val interface{}) (interface{}, error) { func (p *parser) callonAttrValDQin1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttrValDQin1(stack["val"]) -} - -func (c *current) onAttrValDQEsc1() (interface{}, error) { - return `"`, nil -} - -func (p *parser) callonAttrValDQEsc1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onAttrValDQEsc1() -} - -func (c *current) onAttrValPosFB1() (interface{}, error) { - return strings.TrimSpace(string(c.text)), nil -} - -func (p *parser) callonAttrValPosFB1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onAttrValPosFB1() -} - -func (c *current) onAttrValNamedFB1() (interface{}, error) { - return strings.TrimSpace(string(c.text)), nil -} - -func (p *parser) callonAttrValNamedFB1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onAttrValNamedFB1() -} - -func (c *current) onShortHandValuePlain1() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonShortHandValuePlain1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onShortHandValuePlain1() + return p.cur.onAttrValDQin1(stack["val"]) } -func (c *current) onNamedAttr1(key, value interface{}) (interface{}, error) { - return types.NewElementNamedAttr(key.(string), value.(string)) +func (c *current) onAttrValDQEsc1() (interface{}, error) { + return `"`, nil } -func (p *parser) callonNamedAttr1() (interface{}, error) { +func (p *parser) callonAttrValDQEsc1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttr1(stack["key"], stack["value"]) + return p.cur.onAttrValDQEsc1() } -func (c *current) onNamedAttrKey1() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttrValPosFB1() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil } -func (p *parser) callonNamedAttrKey1() (interface{}, error) { +func (p *parser) callonAttrValPosFB1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttrKey1() + return p.cur.onAttrValPosFB1() } -func (c *current) onAttrValuePlain1() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttrValNamedFB1() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil } -func (p *parser) callonAttrValuePlain1() (interface{}, error) { +func (p *parser) callonAttrValNamedFB1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttrValuePlain1() + return p.cur.onAttrValNamedFB1() } -func (c *current) onAttrValueSingleQuoted1() (interface{}, error) { - return string(c.text[1 : len(c.text)-1]), nil +func (c *current) onShortHandValuePlain4() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonAttrValueSingleQuoted1() (interface{}, error) { +func (p *parser) callonShortHandValuePlain4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttrValueSingleQuoted1() + return p.cur.onShortHandValuePlain4() } -func (c *current) onAttrValueDoubleQuoted1() (interface{}, error) { - return string(c.text[1 : len(c.text)-1]), nil +func (c *current) onShortHandValuePlain12() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonAttrValueDoubleQuoted1() (interface{}, error) { +func (p *parser) callonShortHandValuePlain12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttrValueDoubleQuoted1() + return p.cur.onShortHandValuePlain12() } -func (c *current) onAttrValueNone1() (interface{}, error) { - return "", nil +func (c *current) onShortHandValuePlain1(first, others interface{}) (interface{}, error) { + return append([]interface{}{first}, others.([]interface{})...), nil + } -func (p *parser) callonAttrValueNone1() (interface{}, error) { +func (p *parser) callonShortHandValuePlain1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttrValueNone1() + return p.cur.onShortHandValuePlain1(stack["first"], stack["others"]) } -func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) +func (c *current) onNamedAttr1(key, value interface{}) (interface{}, error) { + return types.NewElementNamedAttr(key.(string), value) } -func (p *parser) callonSingleQuotedString1() (interface{}, error) { +func (p *parser) callonNamedAttr1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedString1(stack["elements"]) + return p.cur.onNamedAttr1(stack["key"], stack["value"]) } -func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onNamedAttrKey1() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonNamedAttrKey1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElements1(stack["elements"]) + return p.cur.onNamedAttrKey1() } -func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onAttrValuePlain1() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonAttrValuePlain1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement1(stack["element"]) + return p.cur.onAttrValuePlain1() } -func (c *current) onSingleQuotedStringFallbackCharacter3() (interface{}, error) { +func (c *current) onAttrValueSingleQuoted7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuotedStringFallbackCharacter3() (interface{}, error) { +func (p *parser) callonAttrValueSingleQuoted7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringFallbackCharacter3() + return p.cur.onAttrValueSingleQuoted7() } -func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) +func (c *current) onAttrValueSingleQuoted1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonDoubleQuotedString1() (interface{}, error) { +func (p *parser) callonAttrValueSingleQuoted1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedString1(stack["elements"]) + return p.cur.onAttrValueSingleQuoted1(stack["elements"]) } -func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onAttrValueDoubleQuoted7() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonAttrValueDoubleQuoted7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElements1(stack["elements"]) + return p.cur.onAttrValueDoubleQuoted7() } -func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onAttrValueDoubleQuoted1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonAttrValueDoubleQuoted1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement1(stack["element"]) + return p.cur.onAttrValueDoubleQuoted1(stack["elements"]) } -func (c *current) onDoubleQuotedStringFallbackCharacter1() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onAttrValueNone1() (interface{}, error) { + return "", nil } -func (p *parser) callonDoubleQuotedStringFallbackCharacter1() (interface{}, error) { +func (p *parser) callonAttrValueNone1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringFallbackCharacter1() + return p.cur.onAttrValueNone1() } func (c *current) onSection7() (interface{}, error) { @@ -18946,6 +18882,16 @@ func (p *parser) callonContinuedRawParagraph12() (interface{}, error) { return p.cur.onContinuedRawParagraph12(stack["attributes"], stack["lines"]) } +func (c *current) onContinuedRawParagraphLines7(line interface{}) (interface{}, error) { + return line, nil +} + +func (p *parser) callonContinuedRawParagraphLines7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onContinuedRawParagraphLines7(stack["line"]) +} + func (c *current) onContinuedRawParagraphLines1(firstLine, otherLines interface{}) (interface{}, error) { return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } @@ -19089,6 +19035,16 @@ func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { return p.cur.onDoubleQuoteBoldText1(stack["attrs"], stack["elements"]) } +func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { + return element, nil +} + +func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) +} + 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)) @@ -19180,6 +19136,16 @@ func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { return p.cur.onDoubleQuoteItalicText1(stack["attrs"], stack["elements"]) } +func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { + return element, nil +} + +func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteItalicTextElement1(stack["element"]) +} + 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)) @@ -19271,6 +19237,29 @@ func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { return p.cur.onDoubleQuoteMonospaceText1(stack["attrs"], stack["elements"]) } +func (c *current) onDoubleQuoteMonospaceTextElement14() (interface{}, error) { + // must be before SingleQuoteMonospaceText + // do not convert to apostrophe (yet) + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDoubleQuoteMonospaceTextElement14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMonospaceTextElement14() +} + +func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { + return element, nil +} + +func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) +} + 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)) @@ -19304,6 +19293,18 @@ func (p *parser) callonSingleQuoteMonospaceText14() (interface{}, error) { return p.cur.onSingleQuoteMonospaceText14(stack["attrs"], stack["elements"]) } +func (c *current) onSingleQuoteMonospaceTextElement22() (interface{}, error) { + // do not convert to apostrophe (yet) + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonSingleQuoteMonospaceTextElement22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuoteMonospaceTextElement22() +} + 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)) @@ -19351,6 +19352,86 @@ func (p *parser) callonEscapedMonospaceText18() (interface{}, error) { return p.cur.onEscapedMonospaceText18(stack["backslashes"], stack["elements"]) } +func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) +} + +func (p *parser) callonSingleQuotedString1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuotedString1(stack["elements"]) +} + +func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements) +} + +func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuotedStringElements1(stack["elements"]) +} + +func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { + return element, nil +} + +func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuotedStringElement1(stack["element"]) +} + +func (c *current) onSingleQuotedStringFallbackCharacter3() (interface{}, error) { + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonSingleQuotedStringFallbackCharacter3() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuotedStringFallbackCharacter3() +} + +func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) +} + +func (p *parser) callonDoubleQuotedString1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuotedString1(stack["elements"]) +} + +func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements) +} + +func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuotedStringElements1(stack["elements"]) +} + +func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { + return element, nil +} + +func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuotedStringElement1(stack["element"]) +} + +func (c *current) onDoubleQuotedStringFallbackCharacter1() (interface{}, error) { + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDoubleQuotedStringFallbackCharacter1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuotedStringFallbackCharacter1() +} + func (c *current) onDoubleQuoteMarkedText1(attrs, elements interface{}) (interface{}, error) { // double punctuation must be evaluated first return types.NewQuotedText(types.Marked, attrs, elements.([]interface{})) @@ -19673,15 +19754,15 @@ func (p *parser) callonFirstLinkAttributeElement4() (interface{}, error) { return p.cur.onFirstLinkAttributeElement4(stack["elements"]) } -func (c *current) onFirstLinkAttributeElement19(elements interface{}) (interface{}, error) { +func (c *current) onFirstLinkAttributeElement20(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonFirstLinkAttributeElement19() (interface{}, error) { +func (p *parser) callonFirstLinkAttributeElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstLinkAttributeElement19(stack["elements"]) + return p.cur.onFirstLinkAttributeElement20(stack["elements"]) } func (c *current) onFirstLinkAttributeElement1(element interface{}) (interface{}, error) { @@ -19758,6 +19839,7 @@ func (p *parser) callonResolvedExternalLink1() (interface{}, error) { } func (c *current) onImageBlock1(attributes, path, inlineAttrs interface{}) (interface{}, error) { + // 'imagesdir' attribute is added after applying the attribute substitutions on the image location return types.NewImageBlock(path.(types.Location), inlineAttrs.(types.Attributes), attributes) } @@ -19768,7 +19850,7 @@ func (p *parser) callonImageBlock1() (interface{}, error) { } func (c *current) onInlineImage1(path, inlineAttrs interface{}) (interface{}, error) { - return types.NewInlineImage(path.(types.Location), inlineAttrs.(types.Attributes)) + return types.NewInlineImage(path.(types.Location), inlineAttrs.(types.Attributes), c.globalStore["imagesdir"]) } func (p *parser) callonInlineImage1() (interface{}, error) { @@ -19828,7 +19910,7 @@ func (p *parser) callonImageHeight1() (interface{}, error) { } func (c *current) onImageAltAttr1(value interface{}) (interface{}, error) { - return types.NewElementNamedAttr(types.AttrImageAlt, value.(string)) + return types.NewElementNamedAttr(types.AttrImageAlt, value) } func (p *parser) callonImageAltAttr1() (interface{}, error) { @@ -19839,7 +19921,7 @@ func (p *parser) callonImageAltAttr1() (interface{}, error) { func (c *current) onImageWidthAttr1(value interface{}) (interface{}, error) { if value != nil { - return types.NewElementNamedAttr(types.AttrWidth, value.(string)) + return types.NewElementNamedAttr(types.AttrWidth, value) } return nil, nil } @@ -19852,7 +19934,7 @@ func (p *parser) callonImageWidthAttr1() (interface{}, error) { func (c *current) onImageHeightAttr1(value interface{}) (interface{}, error) { if value != nil { - return types.NewElementNamedAttr(types.AttrImageHeight, value.(string)) + return types.NewElementNamedAttr(types.AttrImageHeight, value) } return nil, nil } @@ -20132,6 +20214,26 @@ func (p *parser) callonThematicBreak1() (interface{}, error) { return p.cur.onThematicBreak1() } +func (c *current) onElementPlaceHolder5() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonElementPlaceHolder5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onElementPlaceHolder5() +} + +func (c *current) onElementPlaceHolder1(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonElementPlaceHolder1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onElementPlaceHolder1(stack["ref"]) +} + func (c *current) onNormalBlockElement1(element interface{}) (interface{}, error) { return element, nil @@ -20184,6 +20286,17 @@ func (p *parser) callonCallout1() (interface{}, error) { return p.cur.onCallout1(stack["ref"]) } +func (c *current) onInlinePassthroughSubstitution1(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonInlinePassthroughSubstitution1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlinePassthroughSubstitution1(stack["elements"]) +} + func (c *current) onQuotedTextSubstitution1(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) @@ -20195,6 +20308,17 @@ func (p *parser) callonQuotedTextSubstitution1() (interface{}, error) { return p.cur.onQuotedTextSubstitution1(stack["elements"]) } +func (c *current) onQuotedTextAndInlineMacrosSubstitution1(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonQuotedTextAndInlineMacrosSubstitution1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuotedTextAndInlineMacrosSubstitution1(stack["elements"]) +} + func (c *current) onInlineMacrosSubstitution1(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) @@ -20525,14 +20649,14 @@ func (p *parser) callonIndexTerm1() (interface{}, error) { return p.cur.onIndexTerm1(stack["term"]) } -func (c *current) onIndexTermContent10() (interface{}, error) { +func (c *current) onIndexTermContent11() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonIndexTermContent10() (interface{}, error) { +func (p *parser) callonIndexTermContent11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent10() + return p.cur.onIndexTermContent11() } func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) { @@ -20656,14 +20780,27 @@ func (p *parser) callonImpliedApostrophe1() (interface{}, error) { return p.cur.onImpliedApostrophe1() } -func (c *current) onSpecialCharacter1() (interface{}, error) { +func (c *current) onSpecialCharacter3() (interface{}, error) { + // if we have a InternalCrossReference or a Callout, we just return a StringElement. + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonSpecialCharacter3() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSpecialCharacter3() +} + +func (c *current) onSpecialCharacter5() (interface{}, error) { return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonSpecialCharacter1() (interface{}, error) { +func (p *parser) callonSpecialCharacter5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacter1() + return p.cur.onSpecialCharacter5() } func (c *current) onAlphanums1() (interface{}, error) { diff --git a/pkg/parser/parser.peg b/pkg/parser/parser.peg index 0f43ec2c..b6407245 100644 --- a/pkg/parser/parser.peg +++ b/pkg/parser/parser.peg @@ -254,7 +254,7 @@ ElementAttribute <- &("[" / "." ) // skip if the content does not start with one } ElementID <- "[[" id:(ID) "]]" Space* EOL { - return types.NewElementID(id.(string)) + return types.NewElementID(id) } InlineElementID <- "[[" id:(ID) "]]" Space* { // no EOL here since there can be multiple InlineElementID on the same line @@ -286,19 +286,19 @@ BlockAttrList <- '[' attrs:(BlockAttrStyle? ShortHandAttr* BlockAttrPositional2? } BlockAttrStyle <- style:PositionalValue { - return types.NewElementStyle(style.(string)) + return types.NewElementStyle(style) } BlockAttrPositional2 <- Space* "," Space* value:PositionalValue? { if value != nil { - return types.NewElementNamedAttr(types.AttrPositional2, value.(string)) + return types.NewElementNamedAttr(types.AttrPositional2, value) } return nil, nil } BlockAttrPositional3 <- Space* "," Space* value:PositionalValue? { if value != nil { - return types.NewElementNamedAttr(types.AttrPositional3, value.(string)) + return types.NewElementNamedAttr(types.AttrPositional3, value) } return nil, nil } @@ -368,7 +368,7 @@ QuotedTextAttrs <- "[" attrs:(QuotedTextAttrRole? ShortHandAttr* NamedAttr*) "]" } QuotedTextAttrRole <- role:PositionalValue { - return types.NewElementRole(role.(string)) + return types.NewElementRole(role) } StandaloneAttributes <- attributes:(ElementAttribute)+ BlankLine* EOF { // standalone attributes, i.e., with nothing afterwards @@ -378,20 +378,20 @@ StandaloneAttributes <- attributes:(ElementAttribute)+ BlankLine* EOF { // stand ShortHandAttr <- ShortHandAttrID / ShortHandAttrOption / ShortHandAttrRole ShortHandAttrOption <- "%" option:ShortHandValue &[,#%.\r\n\]] { - return types.NewElementOption(option.(string)) + return types.NewElementOption(option) } ShortHandAttrID <- "#" id:ShortHandValue &[,#%.\r\n\]] { - return types.NewElementID(id.(string)) + return types.NewElementID(id) } ShortHandAttrRole <- '.' role:ShortHandValue &[,#%.\r\n\]] { - return types.NewElementRole(role.(string)) + return types.NewElementRole(role) } // PositionalValue is an unnamed attribute. PositionalValue <- value:ShortHandValue &[,#%.\]] { - return value.(string), nil + return value, nil } InlineVal <- AttrEmpty / AttrValSQ / AttrValDQ / AttrValPosFB @@ -434,12 +434,22 @@ ShortHandValue <- ShortHandValuePlain / AttrValueSingleQuoted / AttrValueDoubleQ // ShortHandValuePlain is sort of like AttrValuePlain, but it also needs to exclude the characters // used to start a short hand role, id, or option, as well as equals signs. -ShortHandValuePlain <- [^,\r\n"' \t.#%=\]] ([^ \t,\r\n"'.#%=\]] / [ \t][^ \t,\r\n"'.#%=\]])* { - return string(c.text), nil -} +//ShortHandValuePlain <- [^,\r\n"' \t.#%=\]] ([^ \t,\r\n"'.#%=\]] / [ \t][^ \t,\r\n"'.#%=\]])* { +// return string(c.text), nil +//} +ShortHandValuePlain <- first:([^,\r\n"' \t.#%=\]] { + return types.NewStringElement(string(c.text)) + }) + others: (ElementPlaceHolder + / ([^ \t,\r\n"'.#%=\]] / [ \t][^ \t,\r\n"'.#%=\]] { + return types.NewStringElement(string(c.text)) + }) + )* { + return append([]interface{}{first}, others.([]interface{})...), nil + } NamedAttr <-( "," Space* )? key:NamedAttrKey Space* "=" Space* value:NamedAttrValue Space* { - return types.NewElementNamedAttr(key.(string), value.(string)) + return types.NewElementNamedAttr(key.(string), value) } // The spec says attributes have be alphanumeric but does not consider foreign letters. We are more generous. @@ -453,13 +463,19 @@ AttrValuePlain <- [^,\r\n"' \t\]]+ { return string(c.text), nil } -AttrValueSingleQuoted <- "'" [^'\r\n]+ "'" { - return string(c.text[1:len(c.text)-1]), nil -} +AttrValueSingleQuoted <- "'" elements:( + ([^'\r\n\uFFFD]+ { + return types.NewStringElement(string(c.text)) + }) / ElementPlaceHolder)+ "'" { + return elements, nil + } -AttrValueDoubleQuoted <- "\"" [^"\r\n]+ "\"" { - return string(c.text[1:len(c.text)-1]), nil -} +AttrValueDoubleQuoted <- "\"" elements:( + ([^"\r\n\uFFFD]+ { + return types.NewStringElement(string(c.text)) + }) / ElementPlaceHolder)+ "\"" { + return elements, nil + } // TODO: None is magic word meant to undefine the attribute. It is unclear what the value of this is. // For now we just set it to the empty string. That should have the same effect in practice. @@ -467,92 +483,6 @@ AttrValueNone <- "None" { return "", nil } -// ------------------------------------------------------ -// Quoted Strings (between curly single or double quotes) -// ------------------------------------------------------ - -QuotedString <- SingleQuotedString / DoubleQuotedString - -SingleQuotedString <- SingleQuoteStringStart elements:SingleQuotedStringElements SingleQuoteStringEnd { - return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) -} - -SingleQuotedStringElements <- elements:(SingleQuotedStringElement+) { - return types.NewInlineElements(elements) -} - -SingleQuoteStringStart <- "'`" ![ \t\r\n] - -SingleQuoteStringEnd <- "`'" - -// We have to treat this one special, because of ambiguity with monospace markup. -SingleQuotedStringElement <- element:( - LineBreak !SingleQuoteStringEnd // must be before spaces - / Space+ !SingleQuoteStringEnd - / !"`" Symbol // Exclude the explicit quote - / InlineIcon - / InlineImage - / InlineFootnote - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / Link - / AttributeSubstitution - / BoldText - / ItalicText - / MarkedText - / SubscriptText - / SuperscriptText - / !"`'" MonospaceText - / DoubleQuotedString - / ImpliedApostrophe - / SpecialCharacter - / SingleQuotedStringFallbackCharacter) { - return element, nil -} - -SingleQuotedStringFallbackCharacter <- [^\r\n\t `] / "`" !"'" { - return types.NewStringElement(string(c.text)) -} - -DoubleQuotedString <- DoubleQuoteStringStart elements:DoubleQuotedStringElements DoubleQuoteStringEnd { - return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) -} - -DoubleQuotedStringElements <- elements:(DoubleQuotedStringElement+) { - return types.NewInlineElements(elements) -} - -// We have to treat this one special, because of ambiguity with monospace markup. -DoubleQuotedStringElement <- element:( - LineBreak !DoubleQuoteStringEnd // must be before spaces - / Space+ !DoubleQuoteStringEnd - / InlineIcon - / InlineImage - / InlineFootnote - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / Symbol - / SpecialCharacter - / Link - / AttributeSubstitution - / BoldText - / ItalicText - / MarkedText - / SubscriptText - / SuperscriptText - / !"`\"" MonospaceText - / SingleQuotedString - / ImpliedApostrophe - / DoubleQuotedStringFallbackCharacter) { - return element, nil -} - -DoubleQuoteStringStart <- "\"`" ![ \t\r\n] - -DoubleQuoteStringEnd <- "`\"" - -DoubleQuotedStringFallbackCharacter <- ([^\r\n\t `] / "`" !"\"") { - return types.NewStringElement(string(c.text)) -} - // ------------------------------------------ // Sections // ------------------------------------------ @@ -576,18 +506,19 @@ TitleElements <- elements:(!Newline !InlineElementID TitleElement)+ { // absorbs TitleElement <- element:(Word / LineBreak // must be before spaces / Space+ - / CrossReference // must be before the SpecialCharacter rule - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / InlineIcon - / InlineImage - / Link - / InlineFootnote - / QuotedString - / QuotedText - / SpecialCharacter - / Symbol - / AttributeSubstitution - / ImpliedApostrophe + // CrossReference // must be before the SpecialCharacter rule + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // InlineIcon + // InlineImage + // Link + // InlineFootnote + // QuotedString + // QuotedText + // SpecialCharacter + // Symbol + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder / AnyChar) { return element, nil } @@ -1083,7 +1014,7 @@ ContinuedRawParagraph <- return types.NewParagraph(lines.([]interface{}), attributes) } -ContinuedRawParagraphLines <- firstLine:(FirstParagraphRawLine) otherLines:(!ListItemContinuation (SingleLineComment / RawParagraphLine))* { +ContinuedRawParagraphLines <- firstLine:(FirstParagraphRawLine) otherLines:(!ListItemContinuation line:(SingleLineComment / RawParagraphLine) { return line, nil })* { return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } @@ -1118,7 +1049,7 @@ InlineElements <- !BlankLine } InlineElement <- - element:(InlineWord // more permissive than words + element:(InlineWord // more permissive than the 'Word' rule / LineBreak // must be before spaces / Space+ / !EOL ( @@ -1129,7 +1060,7 @@ InlineElement <- / Link / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) / InlineFootnote - / CrossReference + / CrossReference // must appear before SpecialCharacter / SpecialCharacter / Symbol / InlineUserMacro @@ -1138,6 +1069,7 @@ InlineElement <- / ConcealedIndexTerm / IndexTerm / ImpliedApostrophe + / ElementPlaceHolder / AnyChar)) { return element, nil } @@ -1202,9 +1134,10 @@ DoubleQuoteBoldText <- attrs:(QuotedTextAttrs)? "**" elements:(DoubleQuoteBoldTe return types.NewQuotedText(types.Bold, attrs, elements.([]interface{})) } -DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement (!("**") (Space / DoubleQuoteBoldTextElement))* // may start and end with spaces +DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement* -DoubleQuoteBoldTextElement <- Word +DoubleQuoteBoldTextElement <- !("**") element:(Word + / Space // may start and end with spaces / Newline !Newline / SingleQuoteBoldText / QuotedString @@ -1213,16 +1146,18 @@ DoubleQuoteBoldTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / SpecialCharacter - / Symbol - / InlineIcon - / InlineImage - / Link - / AttributeSubstitution - / ImpliedApostrophe - / DoubleQuoteBoldTextFallbackCharacter - + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // SpecialCharacter + // Symbol + // InlineIcon + // InlineImage + // Link + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder + / DoubleQuoteBoldTextFallbackCharacter) { + return element, nil +} DoubleQuoteBoldTextFallbackCharacter <- [^\r\n*] // anything except EOL and bold delimiter (fallback in case nothing else matched) @@ -1248,14 +1183,15 @@ SingleQuoteBoldTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / SpecialCharacter - / Symbol - / InlineIcon - / InlineImage - / Link - / AttributeSubstitution - / ImpliedApostrophe + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // SpecialCharacter + // Symbol + // InlineIcon + // InlineImage + // Link + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder / SingleQuoteBoldTextFallbackCharacter SingleQuoteBoldTextFallbackCharacter <- @@ -1284,9 +1220,10 @@ DoubleQuoteItalicText <- attrs:(QuotedTextAttrs)? "__" elements:(DoubleQuoteItal return types.NewQuotedText(types.Italic, attrs, elements.([]interface{})) } -DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement (!("__") (Space / DoubleQuoteItalicTextElement))* // may start and end with spaces +DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement* -DoubleQuoteItalicTextElement <- Word +DoubleQuoteItalicTextElement <- !("__") element:(Word + / Space // may start and end with spaces / Newline !Newline / SingleQuoteItalicText / QuotedString @@ -1295,14 +1232,17 @@ DoubleQuoteItalicTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / SpecialCharacter - / Symbol - / InlineIcon - / InlineImage - / Link - / ImpliedApostrophe - / DoubleQuoteItalicTextFallbackCharacter + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // SpecialCharacter + // Symbol + // InlineIcon + // InlineImage + // Link + // ImpliedApostrophe + / ElementPlaceHolder + / DoubleQuoteItalicTextFallbackCharacter) { + return element, nil +} DoubleQuoteItalicTextFallbackCharacter <- [^\r\n_] // anything except EOL and italic delimiter (fallback in case nothing else matched) @@ -1328,14 +1268,15 @@ SingleQuoteItalicTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / SpecialCharacter - / Symbol - / InlineIcon - / InlineImage - / Link - / AttributeSubstitution - / ImpliedApostrophe + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // SpecialCharacter + // Symbol + // InlineIcon + // InlineImage + // Link + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder / SingleQuoteItalicTextFallbackCharacter SingleQuoteItalicTextFallbackCharacter <- @@ -1363,25 +1304,33 @@ DoubleQuoteMonospaceText <- attrs:(QuotedTextAttrs)? "``" elements:(DoubleQuoteM return types.NewQuotedText(types.Monospace, attrs, elements.([]interface{})) } -DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement (!("``") (Space / DoubleQuoteMonospaceTextElement))* // may start and end with spaces +DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement* // may start and end with spaces -DoubleQuoteMonospaceTextElement <- Word +DoubleQuoteMonospaceTextElement <- !("``") element:(Word + / Space // may start and end with spaces / Newline !Newline / QuotedString - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / Symbol - / SpecialCharacter + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // Symbol + // SpecialCharacter + / Apostrophe { // must be before SingleQuoteMonospaceText + // do not convert to apostrophe (yet) + return types.NewStringElement(string(c.text)) + } / SingleQuoteMonospaceText / BoldText / ItalicText / MarkedText / SubscriptText / SuperscriptText - / InlineIcon - / InlineImage - / Link - / ImpliedApostrophe - / DoubleQuoteMonospaceTextFallbackCharacter + // InlineIcon + // InlineImage + // Link + // ImpliedApostrophe + / ElementPlaceHolder + / DoubleQuoteMonospaceTextFallbackCharacter) { + return element, nil +} DoubleQuoteMonospaceTextFallbackCharacter <- [^\r\n`] // anything except EOL and monospace delimiter (fallback in case nothing else matched) @@ -1407,14 +1356,19 @@ SingleQuoteMonospaceTextElement <- Word / MarkedText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / !"`" Symbol - / SpecialCharacter - / InlineIcon - / InlineImage - / Link - / AttributeSubstitution - / ImpliedApostrophe + / Apostrophe { + // do not convert to apostrophe (yet) + return types.NewStringElement(string(c.text)) + } + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // !"`" Symbol + // SpecialCharacter + // InlineIcon + // InlineImage + // Link + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder / SingleQuoteMonospaceTextFallbackCharacter SingleQuoteMonospaceTextFallbackCharacter <- @@ -1433,6 +1387,93 @@ EscapedMonospaceText <- return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{})) } +// ------------------------------------------------------ +// Quoted Strings (between curly single or double quotes) +// ------------------------------------------------------ + +QuotedString <- SingleQuotedString / DoubleQuotedString + +SingleQuotedString <- SingleQuoteStringStart elements:SingleQuotedStringElements SingleQuoteStringEnd { + return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) +} + +SingleQuotedStringElements <- elements:(SingleQuotedStringElement+) { + return types.NewInlineElements(elements) +} + +SingleQuoteStringStart <- "'`" ![ \t\r\n] + +SingleQuoteStringEnd <- "`'" + +// We have to treat this one special, because of ambiguity with monospace markup. +SingleQuotedStringElement <- element:( + LineBreak !SingleQuoteStringEnd // must be before spaces + / Space+ !SingleQuoteStringEnd + / !"`" Symbol // Exclude the explicit quote + // InlineIcon + // InlineImage + // InlineFootnote + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // Link + // AttributeSubstitution + / BoldText + / ItalicText + / MarkedText + / SubscriptText + / SuperscriptText + / !"`'" MonospaceText + / DoubleQuotedString + // ImpliedApostrophe + // SpecialCharacter + / SingleQuotedStringFallbackCharacter) { + return element, nil +} + +SingleQuotedStringFallbackCharacter <- [^\r\n\t `] / "`" !"'" { + return types.NewStringElement(string(c.text)) +} + +DoubleQuotedString <- DoubleQuoteStringStart elements:DoubleQuotedStringElements DoubleQuoteStringEnd { + return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) +} + +DoubleQuotedStringElements <- elements:(DoubleQuotedStringElement+) { + return types.NewInlineElements(elements) +} + +// We have to treat this one special, because of ambiguity with monospace markup. +DoubleQuotedStringElement <- element:( + LineBreak !DoubleQuoteStringEnd // must be before spaces + / Space+ !DoubleQuoteStringEnd + // InlineIcon + // InlineImage + // InlineFootnote + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // Symbol + // SpecialCharacter + // Link + // AttributeSubstitution + / BoldText + / ItalicText + / MarkedText + / SubscriptText + / SuperscriptText + / !"`\"" MonospaceText + /SingleQuotedString + // ImpliedApostrophe + / DoubleQuotedStringFallbackCharacter) { + return element, nil +} + +DoubleQuoteStringStart <- "\"`" ![ \t\r\n] + +DoubleQuoteStringEnd <- "`\"" + +DoubleQuotedStringFallbackCharacter <- ([^\r\n\t `] / "`" !"\"") { + return types.NewStringElement(string(c.text)) +} + + // ----------------- // Marked text // ----------------- @@ -1454,13 +1495,14 @@ DoubleQuoteMarkedTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / Symbol - / SpecialCharacter - / InlineIcon - / InlineImage - / Link - / ImpliedApostrophe + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // Symbol + // SpecialCharacter + // InlineIcon + // InlineImage + // Link + // ImpliedApostrophe + / ElementPlaceHolder / DoubleQuoteMarkedTextFallbackCharacter DoubleQuoteMarkedTextFallbackCharacter <- @@ -1487,14 +1529,15 @@ SingleQuoteMarkedTextElement <- Word / MonospaceText / SubscriptText / SuperscriptText - / Symbol - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / SpecialCharacter - / InlineIcon - / InlineImage - / Link - / AttributeSubstitution - / ImpliedApostrophe + // Symbol + // InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) + // SpecialCharacter + // InlineIcon + // InlineImage + // Link + // AttributeSubstitution + // ImpliedApostrophe + / ElementPlaceHolder / SingleQuoteMarkedTextFallbackCharacter SingleQuoteMarkedTextFallbackCharacter <- @@ -1619,11 +1662,11 @@ LinkAttributes <- "[" firstAttr:(FirstLinkAttributeElement)* FirstLinkAttributeElement <- element:( // surrounded with double quotes - ("\"" elements:(QuotedString / QuotedText / QuotedAttributeChar)+ "\"" &(!"=") ","? { + ("\"" elements:(QuotedString / QuotedText / ElementPlaceHolder / QuotedAttributeChar)+ "\"" &(!"=") ","? { return types.NewInlineElements(elements.([]interface{})) }) / // not surrounded with double quotes - (elements:(QuotedString / QuotedText / UnquotedAttributeChar)+ &(!"=") ","? { + (elements:(QuotedString / QuotedText / ElementPlaceHolder / UnquotedAttributeChar)+ &(!"=") ","? { return types.NewInlineElements(elements.([]interface{})) })) { return element, nil @@ -1647,8 +1690,8 @@ InlineLinks <- / SpecialCharacter / Space+ / ResolvedLink - / Parenthesis - / ImpliedApostrophe + / Parenthesis // TODO: remove? + / ImpliedApostrophe // TODO: remove? / AnyChar / Newline)+ EOF { return types.NewInlineElements(elements.([]interface{})) @@ -1669,11 +1712,12 @@ ResolvedExternalLink <- url:(ResolvedLocation) inlineAttributes:(LinkAttributes) // Images // ------------------------------------------ ImageBlock <- attributes:(BlockImageAttrs)* "image::" path:(Location) inlineAttrs:(InlineImageAttrs) Space* EOL { + // 'imagesdir' attribute is added after applying the attribute substitutions on the image location return types.NewImageBlock(path.(types.Location), inlineAttrs.(types.Attributes), attributes) } InlineImage <- "image:" !":" path:(Location) inlineAttrs:(InlineImageAttrs) { - return types.NewInlineImage(path.(types.Location), inlineAttrs.(types.Attributes)) + return types.NewInlineImage(path.(types.Location), inlineAttrs.(types.Attributes), c.globalStore["imagesdir"]) } InlineImageAttrs <- '[' alt:ImageAltInline w:ImageWidth h:ImageHeight nv:NamedAttrs ']' { @@ -1699,19 +1743,19 @@ ImageHeight <- ","? value:InlineVal? { } ImageAltAttr <- Space* value:PositionalValue Space* { - return types.NewElementNamedAttr(types.AttrImageAlt, value.(string)) + return types.NewElementNamedAttr(types.AttrImageAlt, value) } ImageWidthAttr <- Space* "," Space* value:PositionalValue? { if value != nil { - return types.NewElementNamedAttr(types.AttrWidth, value.(string)) + return types.NewElementNamedAttr(types.AttrWidth, value) } return nil, nil } ImageHeightAttr <- Space* "," Space* value:PositionalValue? { if value != nil { - return types.NewElementNamedAttr(types.AttrImageHeight, value.(string)) + return types.NewElementNamedAttr(types.AttrImageHeight, value) } return nil, nil } @@ -1903,9 +1947,10 @@ ThematicBreak <- ("***" / "* * *" / "---" / "- - -" / "___" / "_ _ _") EOL { // ------------------------------------------------------------------------------------- // extra entrypoint when parsing a whole paragraph line at once during the substition phase +// TODO: remove NormalParagraphContentSubstitution <- ( SingleLineComment / - ( (InlineWord // more permissive than words + ( (InlineWord // more permissive than the 'Word' rule / LineBreak // must be before spaces / Space+ / Quotes @@ -1914,7 +1959,6 @@ NormalParagraphContentSubstitution <- / SpecialCharacter / QuotedString / ImpliedApostrophe - / AttributeSubstitution / AnyChar )+ Newline?) )+ @@ -1931,12 +1975,18 @@ InlineMacros <- InlineIcon / InlineElementID / ConcealedIndexTerm / IndexTerm - + +ElementPlaceHolder <- "\uFFFD" ref:([0-9]+ { return string(c.text), nil }) "\uFFFD" { + return types.NewElementPlaceHolder(ref.(string)) +} + ReplacementsSubstitution <- (Symbol - / InlineWord // more permissive than words - / Space+ - / AnyChar - / Newline)+ EOF + / InlineWord // more permissive than the 'Word' rule + / Space+ + / ImpliedApostrophe + / ElementPlaceHolder + / AnyChar + / Newline)+ EOF // standalone rule when applying substitutions NormalBlockContentSubstitution <- NormalBlockElement* @@ -1976,11 +2026,35 @@ Callout <- "<" ref:([0-9]+ { return strconv.Atoi(string(c.text)) }) ">" Space* & return types.NewCallout(ref.(int)) } +// internal substitution to detect passthrough blocks +InlinePassthroughSubstitution <- + elements:(InlinePassthrough + / InlineWord // more permissive than the 'Word' rule + / Space+ + / AnyChar + / Newline)+ { + return types.NewInlineElements(elements.([]interface{})) + } + // standalone rule for the "quotes" substitution QuotedTextSubstitution <- - elements:(InlineWord // more permissive than words + elements:(InlineWord // more permissive than the 'Word' rule / Space+ / QuotedText + / QuotedString + / ElementPlaceHolder + / AnyChar + / Newline)+ { + return types.NewInlineElements(elements.([]interface{})) + } + +// standalone rule for the "macros" substitution +// TODO: remove (unused)? +QuotedTextAndInlineMacrosSubstitution <- + elements:(InlineWord // more permissive than the 'Word' rule + / Space+ + / QuotedText + / InlineMacros / AnyChar / Newline)+ { return types.NewInlineElements(elements.([]interface{})) @@ -1988,9 +2062,10 @@ QuotedTextSubstitution <- // standalone rule for the "macros" substitution InlineMacrosSubstitution <- - elements:(InlineWord // more permissive than words + elements:(InlineWord // more permissive than the 'Word' rule / Space+ / InlineMacros + / ElementPlaceHolder / AnyChar / Newline)+ { return types.NewInlineElements(elements.([]interface{})) @@ -1998,9 +2073,10 @@ InlineMacrosSubstitution <- // standalone rule for the "attributes" substitution AttributesSubstitution <- - elements:(InlineWord // more permissive than words + elements:(InlineWord // more permissive than the 'Word' rule / Space+ / AttributeSubstitution + / ElementPlaceHolder / AnyChar / Newline)+{ return types.NewInlineElements(elements.([]interface{})) @@ -2015,6 +2091,15 @@ SpecialCharactersSubstitution <- return types.NewInlineElements(elements.([]interface{})) } + +PostReplacementsSubstitution <- ( + InlineWord // more permissive than the 'Word' rule + / ElementPlaceHolder + / LineBreak + / Space+ + / AnyChar + / Newline)+ EOF + // standalone rule for the "none" substitution NoneSubstitution <- ( ([^\r\n]+ EOL { // just text @@ -2170,7 +2255,7 @@ IndexTerm <- "((" term:(IndexTermContent) "))" { return types.NewIndexTerm(term.([]interface{})) } -IndexTermContent <- elements:(Word / QuotedString / QuotedText / Space / SpecialCharacter / (!"))" .) { +IndexTermContent <- elements:(Word / QuotedString / QuotedText / Space / SpecialCharacter / ElementPlaceHolder / (!"))" .) { return string(c.text), nil })+ { return types.NewInlineElements(elements.([]interface{})) @@ -2229,9 +2314,12 @@ ImpliedApostrophe <- Alphanum "'" &[\pL] { // They need to be identified as they may have a special treatment during the rendering // ------------------------------------------------------------------------------------ -SpecialCharacter <- ("<" / ">" / "&" ) { - return types.NewSpecialCharacter(string(c.text)) -} +SpecialCharacter <- InternalCrossReference / Callout { + // if we have a InternalCrossReference or a Callout, we just return a StringElement. + return types.NewStringElement(string(c.text)) + } / ("<" / ">" / "&" ) { + return types.NewSpecialCharacter(string(c.text)) + } // ------------------------------------------ // Base Types @@ -2264,7 +2352,7 @@ AnyChar <- [^\r\n] { return types.NewStringElement(string(c.text)) } -FileLocation <- path:(FILENAME / AttributeSubstitution)+ { +FileLocation <- path:(FILENAME / ElementPlaceHolder)+ { return types.NewLocation("", path.([]interface{})) } @@ -2272,15 +2360,15 @@ ResolvedFileLocation <- path:([^\r\n [])+ { return types.NewLocation("", path.([]interface{})) } -Location <- scheme:(URL_SCHEME)? path:(FILENAME / AttributeSubstitution)+ { +Location <- scheme:(URL_SCHEME)? path:(FILENAME / ElementPlaceHolder)+ { return types.NewLocation(scheme, path.([]interface{})) } -LocationWithScheme <- scheme:(URL_SCHEME) path:(FILENAME / AttributeSubstitution)+ { +LocationWithScheme <- scheme:(URL_SCHEME) path:(FILENAME / ElementPlaceHolder)+ { return types.NewLocation(scheme, path.([]interface{})) } -FILENAME <- ([^\r\n{}[\] ])+ // not supported for now: EOL, space, "[", "]", "{" and "}" as they may be used for document attribute substitutions +FILENAME <- ([^\r\n[\]\uFFFD ])+ // not supported for now: EOL, space, "[", "]" ResolvedLocation <- scheme:(URL_SCHEME) path:(RESOLVED_FILENAME) { return types.NewLocation(scheme, path.([]interface{})) diff --git a/pkg/parser/passthrough_test.go b/pkg/parser/passthrough_test.go index d535b7da..388c316d 100644 --- a/pkg/parser/passthrough_test.go +++ b/pkg/parser/passthrough_test.go @@ -56,8 +56,36 @@ var _ = Describe("passthroughs", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("tripleplus inline passthrough with spaces", func() { - source := `+++ *hello*, world +++` + It("tripleplus inline passthrough with spaces and nested attribute substitution", func() { + source := `:hello: HELLO + ++++ {hello}, world +++` // attribute susbsitution must not occur + expected := types.Document{ + Attributes: types.Attributes{ + "hello": "HELLO", + }, + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + types.StringElement{ + Content: " {hello}, world ", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("tripleplus inline passthrough with spaces aned nested quoted text", func() { + source := `+++ *hello*, world +++` // macro susbsitution must not occur expected := types.Document{ Elements: []interface{}{ types.Paragraph{ @@ -353,6 +381,39 @@ var _ = Describe("passthroughs", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + Context("invalid cases", func() { + It("invalid singleplus passthrough in paragraph", func() { + source := `The text + *hello*, world + is not passed through.` + expected := types.Document{ + Elements: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "The text + ", + }, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{ + Content: "hello", + }, + }, + }, + types.StringElement{ + Content: ", world + is not passed through.", + }, + }, + }, + }, + }, + } + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) + }) + }) + }) Context("passthrough macro", func() { @@ -529,5 +590,6 @@ var _ = Describe("passthroughs", func() { }) }) }) + }) }) diff --git a/pkg/parser/q_a_list_test.go b/pkg/parser/q_a_list_test.go index acd842b3..588b1b1d 100644 --- a/pkg/parser/q_a_list_test.go +++ b/pkg/parser/q_a_list_test.go @@ -67,13 +67,15 @@ What is the answer to the Ultimate Question?:: 42` }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) }) It("q and a with role and id", func() { source := `.Q&A [qanda#quiz] -[.key.role2] +[.role1.role2] What is libasciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` @@ -86,7 +88,7 @@ What is the answer to the Ultimate Question?:: 42` types.AttrStyle: "qanda", types.AttrID: "quiz", types.AttrCustomID: true, - types.AttrRole: []string{"key", "role2"}, + types.AttrRole: []interface{}{types.ElementRole{"role1"}, types.ElementRole{"role2"}}, }, Items: []types.LabeledListItem{ { diff --git a/pkg/parser/quoted_string_test.go b/pkg/parser/quoted_string_test.go index dd9f26ea..ee3e3c4c 100644 --- a/pkg/parser/quoted_string_test.go +++ b/pkg/parser/quoted_string_test.go @@ -10,235 +10,347 @@ import ( var _ = Describe("quoted strings", func() { - Context("inline elements", func() { + Context("draft document", func() { It("simple single quoted string", func() { source := "'`curly was single`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly was single"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly was single"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior spaces with single quoted string", func() { source := "'` curly was single `'" - expected := []interface{}{ - types.StringElement{Content: "'` curly was single \u2019"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "'` curly was single \u2019"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior ending space with single quoted string", func() { source := "'`curly was single `'" - expected := []interface{}{ - types.StringElement{Content: "'`curly was single \u2019"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "'`curly was single \u2019"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior leading space with single quoted string", func() { source := "'` curly was single`'" - expected := []interface{}{ - types.StringElement{Content: "'` curly was single\u2019"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "'` curly was single\u2019"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("bold in single quoted string", func() { source := "'`curly *was* single`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "was"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italics in single quoted string", func() { source := "'`curly _was_ single`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "was"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("span in single quoted string", func() { source := "'`curly [strikeout]#was#_is_ single`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Marked, - Attributes: types.Attributes{types.AttrRole: "strikeout"}, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "is"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Marked, + Attributes: types.Attributes{types.AttrRole: types.ElementRole{"strikeout"}}, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "is"}, + }, + }, + + types.StringElement{Content: " single"}, + }, + }, }, }, - - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in monospace string", func() { source := "'`curly `is` single`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "is"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "is"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly as monospace string", func() { source := "'``curly``'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly with nested double curly", func() { source := "'`single\"`double`\"`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "single"}, - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "double"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "single"}, + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "double"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in monospace string", func() { source := "`'`curly`'`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in italics", func() { source := "_'`curly`'_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in bold", func() { source := "*'`curly`'*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in link", func() { source := "https://www.example.com/a['`example`']" - expected := []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, - }, - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{ + Content: "example", + }, + }, + }, + }, }, }, }, @@ -246,28 +358,36 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("curly in quoted link", func() { source := "https://www.example.com/a[\"an '`example`'\"]" - expected := []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, - }, - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.StringElement{ - Content: "an ", - }, - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.StringElement{ + Content: "an ", + }, + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{ + Content: "example", + }, + }, + }, + }, }, }, }, @@ -275,21 +395,32 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("image in curly", func() { source := "'`a image:foo.png[]`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "foo.png", + }, + }, + }, + }, }, }, }, @@ -297,252 +428,372 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("icon in curly", func() { source := "'`a icon:note[]`'" - expected := []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.Icon{ - Class: "note", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.Icon{ + Class: "note", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("simple double quoted string", func() { source := "\"`curly was single`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly was single"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly was single"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior spaces with double quoted string", func() { source := "\"` curly was single `\"" - expected := []interface{}{ - types.StringElement{Content: "\"` curly was single `\""}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "\"` curly was single `\""}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior ending space with double quoted string", func() { source := "\"`curly was single `\"" - expected := []interface{}{ - types.StringElement{Content: "\"`curly was single `\""}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "\"`curly was single `\""}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("interior leading space with double quoted string", func() { source := "\"` curly was single`\"" - expected := []interface{}{ - types.StringElement{Content: "\"` curly was single`\""}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "\"` curly was single`\""}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("bold in double quoted string", func() { source := "\"`curly *was* single`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "was"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italics in double quoted string", func() { source := "\"`curly _was_ single`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "was"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("span in double quoted string", func() { source := "\"`curly [strikeout]#was#_is_ single`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Marked, - Attributes: types.Attributes{types.AttrRole: "strikeout"}, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "is"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Marked, + Attributes: types.Attributes{types.AttrRole: types.ElementRole{"strikeout"}}, + Elements: []interface{}{ + types.StringElement{Content: "was"}, + }, + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "is"}, + }, + }, + + types.StringElement{Content: " single"}, + }, + }, }, }, - - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly in monospace string", func() { source := "\"`curly `is` single`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "is"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "is"}, + }, + }, + types.StringElement{Content: " single"}, + }, + }, }, }, - types.StringElement{Content: " single"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly as monospace string", func() { source := "\"``curly``\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly with nested single curly", func() { source := "\"`double'`single`'`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "double"}, - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "single"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "double"}, + types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + types.StringElement{Content: "single"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly in monospace string", func() { source := "`\"`curly`\"`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly in italics", func() { source := "_\"`curly`\"_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double curly in bold", func() { source := "*\"`curly`\"*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "curly"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) // In a link, the quotes are ambiguous, and we default to assuming they are for enclosing // the link text. Nest them explicitly if this is needed. It("double curly in link (becomes mono)", func() { source := "https://www.example.com/a[\"`example`\"]" - expected := []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, - }, - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{ - Content: "example", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{ + Content: "example", + }, + }, + }, + }, }, }, }, @@ -550,27 +801,35 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) // This is the unambiguous form. It("curly in quoted link", func() { source := "https://www.example.com/a[\"\"`example`\"\"]" - expected := []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, - }, - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.InlineLink{ + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{ + Content: "example", + }, + }, + }, + }, }, }, }, @@ -578,20 +837,31 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("image in double curly", func() { source := "\"`a image:foo.png[]`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "foo.png", + }, + }, + }, + }, }, }, }, @@ -599,22 +869,30 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("icon in double curly", func() { source := "\"`a icon:note[]`\"" - expected := []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.Icon{ - Class: "note", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.Icon{ + Class: "note", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) diff --git a/pkg/parser/quoted_text_test.go b/pkg/parser/quoted_text_test.go index 1ceae868..6fc0eb7c 100644 --- a/pkg/parser/quoted_text_test.go +++ b/pkg/parser/quoted_text_test.go @@ -10,141 +10,213 @@ import ( var _ = Describe("quoted texts", func() { - Context("inline elements", func() { + Context("draft document", func() { Context("quoted text with single punctuation", func() { It("bold text with newline", func() { source := "*some bold\ncontent*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{ - Content: "some bold\ncontent", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{ + Content: "some bold\ncontent", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic text with 3 words in single quote", func() { source := "_some italic content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{ - Content: "some italic content", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{ + Content: "some italic content", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic text with newline", func() { source := "_some italic\ncontent_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{ - Content: "some italic\ncontent", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{ + Content: "some italic\ncontent", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace text with 3 words", func() { source := "`some monospace content`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{ - Content: "some monospace content", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "some monospace content", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace text with newline", func() { source := "`some monospace\ncontent`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{ - Content: "some monospace\ncontent", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "some monospace\ncontent", + }, + }, + }, + }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("invalid subscript text with 3 words", func() { source := "~some subscript content~" - expected := []interface{}{ - types.StringElement{ - Content: "~some subscript content~", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "~some subscript content~", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("invalid superscript text with 3 words", func() { source := "^some superscript content^" - expected := []interface{}{ - types.StringElement{ - Content: "^some superscript content^", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "^some superscript content^", + }, + }, + }, + }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("bold text within italic text", func() { source := "_some *bold* content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace text within bold text within italic quote", func() { source := "*some _italic and `monospaced content`_*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ types.QuotedText{ - Kind: types.Monospace, + Kind: types.Bold, Elements: []interface{}{ - types.StringElement{ - Content: "monospaced content", + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic and "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "monospaced content", + }, + }, + }, + }, }, }, }, @@ -153,145 +225,225 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic text within italic text", func() { source := "_some _very italic_ content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some _very italic"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some _very italic"}, + }, + }, + types.StringElement{Content: " content_"}, + }, + }, }, }, - types.StringElement{Content: " content_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("bold delimiter text within bold text", func() { source := "*bold*content*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold*content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold*content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic delimiter text within italic text", func() { source := "_italic_content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic_content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic_content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace delimiter text within monospace text", func() { source := "`monospace`content`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace`content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "monospace`content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("non-bold text then bold text", func() { source := "non*bold*content *bold content*" - expected := []interface{}{ - types.StringElement{ - Content: "non*bold*content ", - }, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "non*bold*content ", + }, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("non-italic text then italic text", func() { source := "non_italic_content _italic content_" - expected := []interface{}{ - types.StringElement{ - Content: "non_italic_content ", - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "non_italic_content ", + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("non-monospace text then monospace text", func() { source := "non`monospace`content `monospace content`" - expected := []interface{}{ - types.StringElement{ - Content: "non`monospace`content ", - }, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "non`monospace`content ", + }, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "monospace content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("subscript text attached", func() { source := "O~2~ is a molecule" - expected := []interface{}{ - types.StringElement{Content: "O"}, - types.QuotedText{ - Kind: types.Subscript, - Elements: []interface{}{ - types.StringElement{Content: "2"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "O"}, + types.QuotedText{ + Kind: types.Subscript, + Elements: []interface{}{ + types.StringElement{Content: "2"}, + }, + }, + types.StringElement{Content: " is a molecule"}, + }, + }, }, }, - types.StringElement{Content: " is a molecule"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("superscript text attached", func() { source := "M^me^ White" - expected := []interface{}{ - types.StringElement{Content: "M"}, - types.QuotedText{ - Kind: types.Superscript, - Elements: []interface{}{ - types.StringElement{Content: "me"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "M"}, + types.QuotedText{ + Kind: types.Superscript, + Elements: []interface{}{ + types.StringElement{Content: "me"}, + }, + }, + types.StringElement{Content: " White"}, + }, + }, }, }, - types.StringElement{Content: " White"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("invalid subscript text with 3 words", func() { source := "~some subscript content~" - expected := []interface{}{ - types.StringElement{Content: "~some subscript content~"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "~some subscript content~"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -299,117 +451,181 @@ var _ = Describe("quoted texts", func() { It("bold text of 1 word in double quote", func() { source := "**hello**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "hello"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "hello"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("bold text with newline", func() { source := "**some bold\ncontent**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some bold\ncontent"}, - }, - }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) - - It("italic text with 3 words in double quote", func() { - source := "__some italic content__" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some bold\ncontent"}, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("italic text with 3 words in double quote", func() { + source := "__some italic content__" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some italic content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic text with newline", func() { source := "__some italic\ncontent__" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some italic\ncontent"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some italic\ncontent"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace text with 3 words in double quote", func() { - source := "``some monospace content``" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, + source := "`` some monospace content ``" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: " some monospace content "}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("monospace text with newline", func() { source := "``some monospace\ncontent``" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace\ncontent"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some monospace\ncontent"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("superscript text within italic text", func() { source := "__some ^superscript^ content__" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Superscript, - Elements: []interface{}{ - types.StringElement{Content: "superscript"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Superscript, + Elements: []interface{}{ + types.StringElement{Content: "superscript"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("superscript text within italic text within bold quote", func() { source := "**some _italic and ^superscriptcontent^_**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ types.QuotedText{ - Kind: types.Superscript, + Kind: types.Bold, Elements: []interface{}{ - types.StringElement{Content: "superscriptcontent"}, + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic and "}, + types.QuotedText{ + Kind: types.Superscript, + Elements: []interface{}{ + types.StringElement{Content: "superscriptcontent"}, + }, + }, + }, + }, }, }, }, @@ -417,7 +633,7 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -425,416 +641,679 @@ var _ = Describe("quoted texts", func() { It("inline content with bold text", func() { source := "a paragraph with *some bold content*" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some bold content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid bold text - use case 1", func() { source := "a paragraph with *some bold content" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with *some bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with *some bold content"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid bold text - use case 2", func() { source := "a paragraph with *some bold content *" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with *some bold content *"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with *some bold content *"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid bold text - use case 3", func() { source := "a paragraph with * some bold content*" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with * some bold content*"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with * some bold content*"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("invalid italic text within bold text", func() { source := "some *bold and _italic content _ together*." - expected := []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold and _italic content _ together"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold and _italic content _ together"}, + }, + }, + types.StringElement{Content: "."}, + }, + }, }, }, - types.StringElement{Content: "."}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic text within invalid bold text", func() { source := "some *bold and _italic content_ together *." - expected := []interface{}{ - types.StringElement{Content: "some *bold and "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "some *bold and "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic content"}, + }, + }, + types.StringElement{Content: " together *."}, + }, + }, }, }, - types.StringElement{Content: " together *."}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid subscript text - use case 1", func() { source := "a paragraph with ~some subscript content" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ~some subscript content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ~some subscript content"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid subscript text - use case 2", func() { source := "a paragraph with ~some subscript content ~" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ~some subscript content ~"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ~some subscript content ~"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid subscript text - use case 3", func() { source := "a paragraph with ~ some subscript content~" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ~ some subscript content~"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ~ some subscript content~"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid superscript text - use case 1", func() { source := "a paragraph with ^some superscript content" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ^some superscript content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ^some superscript content"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid superscript text - use case 2", func() { source := "a paragraph with ^some superscript content ^" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ^some superscript content ^"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ^some superscript content ^"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("inline content with invalid superscript text - use case 3", func() { source := "a paragraph with ^ some superscript content^" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with ^ some superscript content^"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with ^ some superscript content^"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("marked text with newline", func() { source := "#some marked\ncontent#" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Marked, - Elements: []interface{}{ - types.StringElement{Content: "some marked\ncontent"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{Content: "some marked\ncontent"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double marked text with newline", func() { source := "##some marked\ncontent##" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Marked, - Elements: []interface{}{ - types.StringElement{Content: "some marked\ncontent"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{Content: "some marked\ncontent"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) Context("attributes", func() { + It("simple role italics", func() { source := "[myrole]_italics_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italics"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "myrole", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italics"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"myrole"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("simple role italics unconstrained", func() { source := "it[uncle]__al__ic" - expected := []interface{}{ - types.StringElement{ - Content: "it", - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "al"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "uncle", - }, - }, - types.StringElement{ - Content: "ic", - }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) - - It("simple role bold", func() { - source := "[myrole]*bold*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "it", + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "al"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"uncle"}, + }, + }, + types.StringElement{ + Content: "ic", + }, + }, + }, }, - Attributes: types.Attributes{ - types.AttrRole: "myrole", + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("simple role bold", func() { + source := "[myrole]*bold*" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"myrole"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("simple role bold unconstrained", func() { source := "it[uncle]**al**ic" - expected := []interface{}{ - types.StringElement{ - Content: "it", - }, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "al"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "uncle", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "it", + }, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "al"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"uncle"}, + }, + }, + types.StringElement{ + Content: "ic", + }, + }, + }, }, }, - types.StringElement{ - Content: "ic", - }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("simple role mono", func() { source := "[myrole]`true`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "true"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "myrole", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "true"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"myrole"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("simple role mono unconstrained", func() { source := "int[uncle]``eg``rate" - expected := []interface{}{ - types.StringElement{ - Content: "int", - }, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "eg"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "uncle", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "int", + }, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "eg"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"uncle"}, + }, + }, + types.StringElement{ + Content: "rate", + }, + }, + }, }, }, - types.StringElement{ - Content: "rate", - }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("role with comma truncates", func() { source := "[myrole,and=nothing]_italics_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italics"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "myrole", - "and": "nothing", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italics"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"myrole"}, + "and": "nothing", + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("short-hand ID only", func() { source := "[#here]*bold*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrID: "here", - types.AttrCustomID: true, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + Attributes: types.Attributes{ + types.AttrID: "here", + types.AttrCustomID: true, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("short-hand role only", func() { source := "[.bob]**bold**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "bob", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"bob"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("marked short-hand role only", func() { source := "[.bob]##the builder##" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Marked, - Elements: []interface{}{ - types.StringElement{Content: "the builder"}, - }, - Attributes: types.Attributes{ - types.AttrRole: "bob", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{Content: "the builder"}, + }, + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"bob"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("short-hand multiple roles and id", func() { - source := "[.r1#anchor.r2.r3]**bold**[#here.second.class]_text_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrRole: []string{"r1", "r2", "r3"}, - types.AttrID: "anchor", - types.AttrCustomID: true, - }, - }, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "text"}, - }, - Attributes: types.Attributes{ - types.AttrRole: []string{"second", "class"}, - types.AttrID: "here", - types.AttrCustomID: true, + source := "[.role1#anchor.role2.role3]**bold**[#here.second.class]_text_" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + Attributes: types.Attributes{ + types.AttrRole: []interface{}{types.ElementRole{"role1"}, types.ElementRole{"role2"}, types.ElementRole{"role3"}}, + types.AttrID: "anchor", + types.AttrCustomID: true, + }, + }, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "text"}, + }, + Attributes: types.Attributes{ + types.AttrRole: []interface{}{types.ElementRole{"second"}, types.ElementRole{"class"}}, + types.AttrID: "here", + types.AttrCustomID: true, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("empty role", func() { source := "[]**bold**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("quoted role", func() { source := "['here, again']**bold**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + // NB: This will confuse the renderer. + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{"here, again"}, + }, + }, + }, + }, }, - // NB: This will confuse the renderer. - Attributes: types.Attributes{ - types.AttrRole: "here, again", + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("quoted role with special chars", func() { + source := "[\"something \"]**bold**" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + // NB: This will confuse the renderer. + Attributes: types.Attributes{ + types.AttrRole: types.ElementRole{ + types.StringElement{ + Content: "something ", + }, + types.SpecialCharacter{ + Name: "<", + }, + types.StringElement{ + Content: "wicked", + }, + types.SpecialCharacter{ + Name: ">", + }, + }, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) // This demonstrates that we cannot inject malicious data in these attributes. // The content is escaped by the renderer, not the parser. It("bad syntax", func() { source := "[.]**bold**" - expected := []interface{}{ - types.StringElement{ - Content: "[.", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "something \"wicked", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: "]", - }, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{ + Content: "[.", + }, + types.SpecialCharacter{ + Name: "<", + }, + types.StringElement{ + Content: "something \"wicked", + }, + types.SpecialCharacter{ + Name: ">", + }, + types.StringElement{ + Content: "]", + }, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -843,468 +1322,701 @@ var _ = Describe("quoted texts", func() { It("italic text within bold text", func() { source := "some *bold and _italic content_ together*." - expected := []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold and "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold and "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic content"}, + }, + }, + types.StringElement{Content: " together"}, + }, + }, + types.StringElement{Content: "."}, }, }, - types.StringElement{Content: " together"}, }, }, - types.StringElement{Content: "."}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote bold within single-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "*some *nested bold* content*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some *nested bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some *nested bold"}, + }, + }, + types.StringElement{Content: " content*"}, + }, + }, }, }, - types.StringElement{Content: " content*"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote bold within double-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "**some **nested bold** content**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested bold"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: " content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + }, + }, + types.StringElement{Content: "nested bold"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: " content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote bold within double-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "**some *nested bold* content**" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "nested bold"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote bold within single-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "*some **nested bold** content*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "nested bold"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote italic within single-quote italic text", func() { // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "_some _nested italic_ content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some _nested italic"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some _nested italic"}, + }, + }, + types.StringElement{Content: " content_"}, + }, + }, }, }, - types.StringElement{Content: " content_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote italic within double-quote italic text", func() { // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "__some __nested italic__ content__" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested italic"}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: " content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + }, + }, + types.StringElement{Content: "nested italic"}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: " content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote italic within double-quote italic text", func() { // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "_some __nested italic__ content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "nested italic"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote italic within single-quote italic text", func() { // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "_some __nested italic__ content_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "nested italic"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote monospace within single-quote monospace text", func() { // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "`some `nested monospace` content`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some `nested monospace"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some `nested monospace"}, + }, + }, + types.StringElement{Content: " content`"}, + }, + }, }, }, - types.StringElement{Content: " content`"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote monospace within double-quote monospace text", func() { // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "``some ``nested monospace`` content``" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested monospace"}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: " content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + }, + }, + types.StringElement{Content: "nested monospace"}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: " content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("single-quote monospace within double-quote monospace text", func() { // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "`some ``nested monospace`` content`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "nested monospace"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("double-quote monospace within single-quote monospace text", func() { // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "`some ``nested monospace`` content`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "nested monospace"}, + }, + }, + types.StringElement{Content: " content"}, + }, + }, }, }, - types.StringElement{Content: " content"}, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("quoted text within marked text", func() { source := "some #marked and _italic_ and *bold* and `monospaced` content together#." - expected := []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.Marked, - Elements: []interface{}{ - types.StringElement{Content: "marked and "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic"}, - }, - }, - types.StringElement{Content: " and "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - types.StringElement{Content: " and "}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "monospaced"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "some "}, + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{Content: "marked and "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic"}, + }, + }, + types.StringElement{Content: " and "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold"}, + }, + }, + types.StringElement{Content: " and "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "monospaced"}, + }, + }, + types.StringElement{Content: " content together"}, + }, + }, + types.StringElement{Content: "."}, }, }, - types.StringElement{Content: " content together"}, }, }, - types.StringElement{Content: "."}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced bold in monospace - case 1", func() { source := "`*a`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "*a"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "*a"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced bold in monospace - case 2", func() { source := "`a*b`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a*b"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("italic in monospace", func() { source := "`_a_`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "a"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "a"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced italic in monospace", func() { source := "`a_b`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a_b"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a_b"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unparsed bold in monospace", func() { source := "`a*b*`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b*"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a*b*"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("parsed subscript in monospace", func() { source := "`a~b~`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a"}, - types.QuotedText{ - Kind: types.Subscript, - Elements: []interface{}{ - types.StringElement{Content: "b"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a"}, + types.QuotedText{ + Kind: types.Subscript, + Elements: []interface{}{ + types.StringElement{Content: "b"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("multiline in single quoted monospace - case 1", func() { source := "`a\nb`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a\nb"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("multiline in double quoted monospace - case 1", func() { source := "`a\nb`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a\nb"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("multiline in single quoted monospace - case 2", func() { source := "`a\n*b*`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a\n"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "b"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("multiline in double quoted monospace - case 2", func() { source := "`a\n*b*`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a\n"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "b"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("link in bold", func() { source := "*a link:/[b]*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.StringElement{ - Content: "b", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineLink{ + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.StringElement{ + Content: "b", + }, + }, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "/", + }, + }, + }, + }, }, }, }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("image in bold", func() { + source := "*a image:foo.png[]*" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "foo.png", + }, + }, + }, + }, }, }, }, @@ -1312,21 +2024,26 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) - It("image in bold", func() { - source := "*a image:foo.png[]*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", + It("singleplus passthrough in bold", func() { + source := "*a +image:foo.png[]+*" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, }, }, }, @@ -1334,66 +2051,63 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) - }) - - It("singleplus passthrough in bold", func() { - source := "*a +image:foo.png[]+*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("tripleplus passthrough in bold", func() { source := "*a +++image:foo.png[]+++*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("link in italic", func() { source := "_a link:/[b]_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.StringElement{ - Content: "b", - }, - }, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineLink{ + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.StringElement{ + Content: "b", + }, + }, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "/", + }, + }, + }, + }, }, }, }, @@ -1401,21 +2115,32 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("image in italic", func() { source := "_a image:foo.png[]_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "foo.png", + }, + }, + }, + }, }, }, }, @@ -1423,66 +2148,90 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("singleplus passthrough in italic", func() { source := "_a +image:foo.png[]+_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("tripleplus passthrough in italic", func() { source := "_a +++image:foo.png[]+++_" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("link in monospace", func() { source := "`a link:/[b]`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - "positional-1": []interface{}{ - types.StringElement{ - Content: "b", - }, - }, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineLink{ + Attributes: types.Attributes{ + "positional-1": []interface{}{ + types.StringElement{ + Content: "b", + }, + }, + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "/", + }, + }, + }, + }, }, }, }, @@ -1490,21 +2239,32 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("image in monospace", func() { source := "`a image:foo.png[]`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "foo", + }, + Location: types.Location{ + Path: []interface{}{ + types.StringElement{ + Content: "foo.png", + }, + }, + }, + }, }, }, }, @@ -1512,45 +2272,61 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("singleplus passthrough in monospace", func() { source := "`a +image:foo.png[]+`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("tripleplus passthrough in monospace", func() { source := "`a +++image:foo.png[]+++`" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "a "}, + types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + types.StringElement{Content: "image:foo.png[]"}, + }, + }, + }, + }, }, }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1561,30 +2337,45 @@ var _ = Describe("quoted texts", func() { It("unbalanced bold text - extra on left", func() { source := "**some bold content*" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "*some bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "*some bold content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced bold text - extra on right", func() { source := "*some bold content**" - expected := []interface{}{ - - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "some bold content"}, + }, + }, + types.StringElement{Content: "*"}, + }, + }, }, }, - types.StringElement{Content: "*"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1592,30 +2383,45 @@ var _ = Describe("quoted texts", func() { It("unbalanced italic text - extra on left", func() { source := "__some italic content_" - expected := []interface{}{ - - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "_some italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "_some italic content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced italic text - extra on right", func() { source := "_some italic content__" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "some italic content"}, + }, + }, + types.StringElement{Content: "_"}, + }, + }, }, }, - types.StringElement{Content: "_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1623,39 +2429,62 @@ var _ = Describe("quoted texts", func() { It("unbalanced monospace text - extra on left", func() { source := "``some monospace content`" - expected := []interface{}{ - - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "`some monospace content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "`some monospace content"}, + }, + }, + }, + }, }, }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("unbalanced monospace text - extra on right", func() { source := "`some monospace content``" - expected := []interface{}{ - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "some monospace content"}, + }, + }, + types.StringElement{Content: "`"}, + }, + }, }, }, - types.StringElement{Content: "`"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) It("inline content with unbalanced bold text", func() { source := "a paragraph with *some bold content" - expected := []interface{}{ - types.StringElement{Content: "a paragraph with *some bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "a paragraph with *some bold content"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1668,50 +2497,98 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with single backslash", func() { source := `\*bold content*` - expected := []interface{}{ - types.StringElement{Content: "*bold content*"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "*bold content*"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with multiple backslashes", func() { source := `\\*bold content*` - expected := []interface{}{ - types.StringElement{Content: `\*bold content*`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\*bold content*`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with double quote", func() { source := `\\**bold content**` - expected := []interface{}{ - types.StringElement{Content: `**bold content**`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `**bold content**`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with double quote and more backslashes", func() { source := `\\\**bold content**` - expected := []interface{}{ - types.StringElement{Content: `\**bold content**`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\**bold content**`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with unbalanced double quote", func() { source := `\**bold content*` - expected := []interface{}{ - types.StringElement{Content: `**bold content*`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `**bold content*`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with unbalanced double quote and more backslashes", func() { source := `\\\**bold content*` - expected := []interface{}{ - types.StringElement{Content: `\\**bold content*`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\\**bold content*`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1719,47 +2596,71 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with nested italic text", func() { source := `\*_italic content_*` - expected := []interface{}{ - types.StringElement{Content: "*"}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "*"}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic content"}, + }, + }, + types.StringElement{Content: "*"}, + }, + }, }, }, - types.StringElement{Content: "*"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with unbalanced double quote and nested italic test", func() { source := `\**_italic content_*` - expected := []interface{}{ - types.StringElement{Content: "**"}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "**"}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "italic content"}, + }, + }, + types.StringElement{Content: "*"}, + }, + }, }, }, - types.StringElement{Content: "*"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped bold text with nested italic", func() { source := `\*bold _and italic_ content*` - expected := []interface{}{ - types.StringElement{Content: "*bold "}, - types.QuotedText{ - Kind: types.Italic, - Elements: []interface{}{ - types.StringElement{Content: "and italic"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "*bold "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{Content: "and italic"}, + }, + }, + types.StringElement{Content: " content*"}, + }, + }, }, }, - types.StringElement{Content: " content*"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1771,50 +2672,98 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with single quote", func() { source := `\_italic content_` - expected := []interface{}{ - types.StringElement{Content: "_italic content_"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "_italic content_"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with single quote and more backslashes", func() { source := `\\_italic content_` - expected := []interface{}{ - types.StringElement{Content: `\_italic content_`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\_italic content_`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with double quote with 2 backslashes", func() { source := `\\__italic content__` - expected := []interface{}{ - types.StringElement{Content: `__italic content__`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `__italic content__`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with double quote with 3 backslashes", func() { source := `\\\__italic content__` - expected := []interface{}{ - types.StringElement{Content: `\__italic content__`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\__italic content__`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with unbalanced double quote", func() { source := `\__italic content_` - expected := []interface{}{ - types.StringElement{Content: `__italic content_`}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `__italic content_`}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with unbalanced double quote and more backslashes", func() { source := `\\\__italic content_` - expected := []interface{}{ - types.StringElement{Content: `\\__italic content_`}, // only 1 backslash remove + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\\__italic content_`}, // only 1 backslash remove + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1822,47 +2771,71 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with nested monospace text", func() { source := `\` + "_`monospace content`_" // gives: \_`monospace content`_ - expected := []interface{}{ - types.StringElement{Content: "_"}, - types.QuotedText{ - Kind: types.Monospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "_"}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{Content: "monospace content"}, + }, + }, + types.StringElement{Content: "_"}, + }, + }, }, }, - types.StringElement{Content: "_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with unbalanced double quote and nested bold test", func() { source := `\__*bold content*_` - expected := []interface{}{ - types.StringElement{Content: "__"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "__"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + types.StringElement{Content: "_"}, + }, + }, }, }, - types.StringElement{Content: "_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped italic text with nested bold text", func() { source := `\_italic *and bold* content_` - expected := []interface{}{ - types.StringElement{Content: "_italic "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "_italic "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "and bold"}, + }, + }, + types.StringElement{Content: " content_"}, + }, + }, }, }, - types.StringElement{Content: " content_"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) }) @@ -1873,50 +2846,98 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with single quote", func() { source := `\` + "`monospace content`" - expected := []interface{}{ - types.StringElement{Content: "`monospace content`"}, // backslash removed + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "`monospace content`"}, // backslash removed + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with single quote and more backslashes", func() { source := `\\` + "`monospace content`" - expected := []interface{}{ - types.StringElement{Content: `\` + "`monospace content`"}, // only 1 backslash removed + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\` + "`monospace content`"}, // only 1 backslash removed + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with double quote", func() { source := `\\` + "`monospace content``" - expected := []interface{}{ - types.StringElement{Content: `\` + "`monospace content``"}, // 2 back slashes "consumed" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\` + "`monospace content``"}, // 2 back slashes "consumed" + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with double quote and more backslashes", func() { source := `\\\` + "``monospace content``" // 3 backslashes - expected := []interface{}{ - types.StringElement{Content: `\` + "``monospace content``"}, // 2 back slashes "consumed" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\` + "``monospace content``"}, // 2 back slashes "consumed" + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with unbalanced double quote", func() { source := `\` + "``monospace content`" - expected := []interface{}{ - types.StringElement{Content: "``monospace content`"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "``monospace content`"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with unbalanced double quote and more backslashes", func() { source := `\\\` + "``monospace content`" // 3 backslashes - expected := []interface{}{ - types.StringElement{Content: `\\` + "``monospace content`"}, // 2 backslashes removed + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\\` + "``monospace content`"}, // 2 backslashes removed + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1924,47 +2945,71 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with nested bold text", func() { source := `\` + "`*bold content*`" // gives: \`*bold content*` - expected := []interface{}{ - types.StringElement{Content: "`"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "`"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + types.StringElement{Content: "`"}, + }, + }, }, }, - types.StringElement{Content: "`"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with unbalanced double backquote and nested bold test", func() { source := `\` + "``*bold content*`" - expected := []interface{}{ - types.StringElement{Content: "``"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "``"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + types.StringElement{Content: "`"}, + }, + }, }, }, - types.StringElement{Content: "`"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped monospace text with nested bold text", func() { source := `\` + "`monospace *and bold* content`" - expected := []interface{}{ - types.StringElement{Content: "`monospace "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "`monospace "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "and bold"}, + }, + }, + types.StringElement{Content: " content`"}, + }, + }, }, }, - types.StringElement{Content: " content`"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) }) @@ -1975,18 +3020,34 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with single quote", func() { source := `\~subscriptcontent~` - expected := []interface{}{ - types.StringElement{Content: "~subscriptcontent~"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "~subscriptcontent~"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped subscript text with single quote and more backslashes", func() { source := `\\~subscriptcontent~` - expected := []interface{}{ - types.StringElement{Content: `\~subscriptcontent~`}, // only 1 backslash removed + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\~subscriptcontent~`}, // only 1 backslash removed + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -1995,32 +3056,48 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with nested bold text", func() { source := `\~*boldcontent*~` - expected := []interface{}{ - types.StringElement{Content: "~"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "boldcontent"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "~"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "boldcontent"}, + }, + }, + types.StringElement{Content: "~"}, + }, + }, }, }, - types.StringElement{Content: "~"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped subscript text with nested bold text", func() { source := `\~subscript *and bold* content~` - expected := []interface{}{ - types.StringElement{Content: `\~subscript `}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\~subscript `}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "and bold"}, + }, + }, + types.StringElement{Content: " content~"}, + }, + }, }, }, - types.StringElement{Content: " content~"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) }) @@ -2031,18 +3108,34 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with single quote", func() { source := `\^superscriptcontent^` - expected := []interface{}{ - types.StringElement{Content: "^superscriptcontent^"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "^superscriptcontent^"}, + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped superscript text with single quote and more backslashes", func() { source := `\\^superscriptcontent^` - expected := []interface{}{ - types.StringElement{Content: `\^superscriptcontent^`}, // only 1 backslash removed + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\^superscriptcontent^`}, // only 1 backslash removed + }, + }, + }, + }, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) @@ -2051,51 +3144,270 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with nested bold text - case 1", func() { source := `\^*bold content*^` // valid escaped superscript since it has no space within - expected := []interface{}{ - types.StringElement{Content: `^`}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `^`}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + types.StringElement{Content: "^"}, + }, + }, }, }, - types.StringElement{Content: "^"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped superscript text with unbalanced double backquote and nested bold test", func() { source := `\^*bold content*^` - expected := []interface{}{ - types.StringElement{Content: "^"}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "^"}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, + }, + types.StringElement{Content: "^"}, + }, + }, }, }, - types.StringElement{Content: "^"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("escaped superscript text with nested bold text - case 2", func() { source := `\^superscript *and bold* content^` // invalid superscript text since it has spaces within - expected := []interface{}{ - types.StringElement{Content: `\^superscript `}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: `\^superscript `}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "and bold"}, + }, + }, + types.StringElement{Content: " content^"}, + }, + }, }, }, - types.StringElement{Content: " content^"}, } - Expect(ParseInlineElements(source)).To(MatchInlineElements(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) }) }) }) + + Context("with quoted string", func() { + + It("apostrophes in single bold", func() { + source := "this *mother's mothers' mothers`'*\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in double bold", func() { + source := "this **mother's mothers' mothers`'**\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in single italic", func() { + source := "this _mother's mothers' mothers`'_\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in double italic", func() { + source := "this __mother's mothers' mothers`'__\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in single mono", func() { + source := "this `mother's mothers`' day`\n" // no typographic quotes here + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers\u2019 day", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in double mono", func() { + source := "this ``mother's mothers`' day``\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers\u2019 day", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in single marked", func() { + source := "this #mother's mothers' mothers`'#\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("apostrophes in double marked", func() { + source := "this ##mother's mothers' mothers`'##\n" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Lines: []interface{}{ + []interface{}{ + types.StringElement{Content: "this "}, + types.QuotedText{ + Kind: types.Marked, + Elements: []interface{}{ + types.StringElement{ + Content: "mother\u2019s mothers' mothers\u2019", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + }) }) Context("final document", func() { @@ -2527,7 +3839,7 @@ var _ = Describe("quoted texts", func() { }) It("monospace text with 3 words in double quote", func() { - source := "``some monospace content``" + source := "`` some monospace content ``" expected := types.Document{ Elements: []interface{}{ types.Paragraph{ @@ -2536,7 +3848,7 @@ var _ = Describe("quoted texts", func() { types.QuotedText{ Kind: types.Monospace, Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, + types.StringElement{Content: " some monospace content "}, }, }, }, diff --git a/pkg/parser/table_test.go b/pkg/parser/table_test.go index c82676f5..32da5e19 100644 --- a/pkg/parser/table_test.go +++ b/pkg/parser/table_test.go @@ -200,65 +200,69 @@ var _ = Describe("tables", func() { |row 2, column 1 |row 2, column 2 |===` - expected := types.Table{ - Attributes: types.Attributes{ - types.AttrTitle: "table title", - types.AttrOptions: map[string]bool{"autowidth": true}, - types.AttrRole: []string{"role1", "stretch"}, - types.AttrID: "anchor", - types.AttrCustomID: true, - }, - Header: types.TableLine{ - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "heading 1 ", - }, - }, - { - types.StringElement{ - Content: "heading 2", - }, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Table{ + Attributes: types.Attributes{ + types.AttrTitle: "table title", + types.AttrOptions: map[string]bool{"autowidth": true}, + types.AttrRole: []interface{}{types.ElementRole{"role1"}, types.ElementRole{"stretch"}}, + types.AttrID: "anchor", + types.AttrCustomID: true, }, - }, - }, - Columns: []types.TableColumn{ - // autowidth clears width - {Width: "", HAlign: "left", VAlign: "top"}, - {Width: "", HAlign: "left", VAlign: "top"}, - }, - Lines: []types.TableLine{ - { - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "row 1, column 1", + Header: types.TableLine{ + Cells: [][]interface{}{ + { + types.StringElement{ + Content: "heading 1 ", + }, }, - }, - { - types.StringElement{ - Content: "row 1, column 2", + { + types.StringElement{ + Content: "heading 2", + }, }, }, }, - }, - { - Cells: [][]interface{}{ + Columns: []types.TableColumn{ + // autowidth clears width + {Width: "", HAlign: "left", VAlign: "top"}, + {Width: "", HAlign: "left", VAlign: "top"}, + }, + Lines: []types.TableLine{ { - types.StringElement{ - Content: "row 2, column 1", + Cells: [][]interface{}{ + { + types.StringElement{ + Content: "row 1, column 1", + }, + }, + { + types.StringElement{ + Content: "row 1, column 2", + }, + }, }, }, { - types.StringElement{ - Content: "row 2, column 2", + Cells: [][]interface{}{ + { + types.StringElement{ + Content: "row 2, column 1", + }, + }, + { + types.StringElement{ + Content: "row 2, column 2", + }, + }, }, }, }, }, }, } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) It("empty table ", func() { diff --git a/pkg/parser/unordered_list_test.go b/pkg/parser/unordered_list_test.go index ab056724..1dd5ef10 100644 --- a/pkg/parser/unordered_list_test.go +++ b/pkg/parser/unordered_list_test.go @@ -49,7 +49,7 @@ var _ = Describe("unordered lists", func() { types.AttrTitle: "mytitle", types.AttrID: "listID", types.AttrCustomID: true, - types.AttrRole: "myrole", + types.AttrRole: types.ElementRole{"myrole"}, }, Level: 1, BulletStyle: types.OneAsterisk, @@ -80,7 +80,7 @@ var _ = Describe("unordered lists", func() { types.AttrTitle: "mytitle", types.AttrID: "listID", types.AttrCustomID: true, - types.AttrRole: "myrole", + types.AttrRole: types.ElementRole{"myrole"}, types.AttrStyle: "square", }, Level: 1, @@ -1483,7 +1483,7 @@ paragraph attached to parent list item` types.AttrID: "listID", types.AttrCustomID: true, types.AttrTitle: "mytitle", - types.AttrRole: "myrole", + types.AttrRole: types.ElementRole{"myrole"}, }, Items: []types.UnorderedListItem{ { diff --git a/pkg/renderer/sgml/callout_list.go b/pkg/renderer/sgml/callout_list.go index 1c53b692..3894c31c 100644 --- a/pkg/renderer/sgml/callout_list.go +++ b/pkg/renderer/sgml/callout_list.go @@ -20,7 +20,11 @@ func (r *sgmlRenderer) renderCalloutList(ctx *renderer.Context, l types.CalloutL return "", errors.Wrap(err, "unable to render callout list item") } } - err := r.calloutList.Execute(result, struct { + roles, err := r.renderElementRoles(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + err = r.calloutList.Execute(result, struct { Context *renderer.Context ID string Title string @@ -31,7 +35,7 @@ func (r *sgmlRenderer) renderCalloutList(ctx *renderer.Context, l types.CalloutL Context: ctx, ID: r.renderElementID(l.Attributes), Title: r.renderElementTitle(l.Attributes), - Roles: r.renderElementRoles(l.Attributes), + Roles: roles, Content: string(content.String()), Items: l.Items, }) diff --git a/pkg/renderer/sgml/cross_reference.go b/pkg/renderer/sgml/cross_reference.go index 15802d80..d4ca1a20 100644 --- a/pkg/renderer/sgml/cross_reference.go +++ b/pkg/renderer/sgml/cross_reference.go @@ -63,8 +63,8 @@ func (r *sgmlRenderer) renderExternalCrossReference(ctx *renderer.Context, xref } func getCrossReferenceLocation(xref types.ExternalCrossReference) string { - loc := xref.Location.String() - ext := filepath.Ext(xref.Location.String()) + loc := xref.Location.Stringify() + ext := filepath.Ext(xref.Location.Stringify()) log.Debugf("ext of '%s': '%s'", loc, ext) return loc[:len(loc)-len(ext)] + ".html" // TODO output extension } diff --git a/pkg/renderer/sgml/delimited_block.go b/pkg/renderer/sgml/delimited_block.go index 9276ac5b..30f5a4b3 100644 --- a/pkg/renderer/sgml/delimited_block.go +++ b/pkg/renderer/sgml/delimited_block.go @@ -56,6 +56,11 @@ func (r *sgmlRenderer) renderFencedBlock(ctx *renderer.Context, b types.Delimite if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block roles") + } + err = r.fencedBlock.Execute(result, struct { Context *renderer.Context ID string @@ -67,7 +72,7 @@ func (r *sgmlRenderer) renderFencedBlock(ctx *renderer.Context, b types.Delimite Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Content: content, Elements: elements, }) @@ -89,6 +94,10 @@ func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b types.Delimit if err != nil { return "", errors.Wrap(err, "unable to render listing block content") } + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render listing block roles") + } err = r.listingBlock.Execute(result, struct { Context *renderer.Context @@ -101,7 +110,7 @@ func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b types.Delimit Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Content: content, Elements: discardTrailingBlankLines(b.Elements), }) @@ -246,9 +255,12 @@ func (r *sgmlRenderer) renderSourceBlock(ctx *renderer.Context, b types.Delimite return "", err } } - + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render source block roles") + } result := &bytes.Buffer{} - err := r.sourceBlock.Execute(result, struct { + err = r.sourceBlock.Execute(result, struct { ID string Title string Roles string @@ -259,7 +271,7 @@ func (r *sgmlRenderer) renderSourceBlock(ctx *renderer.Context, b types.Delimite ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), SyntaxHighlighter: highlighter, - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Language: language, Content: content, }) @@ -279,6 +291,10 @@ func (r *sgmlRenderer) renderAdmonitionBlock(ctx *renderer.Context, b types.Deli if err != nil { return "", errors.Wrap(err, "unable to render admonition block content") } + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } err = r.admonitionBlock.Execute(result, struct { Context *renderer.Context ID string @@ -292,7 +308,7 @@ func (r *sgmlRenderer) renderAdmonitionBlock(ctx *renderer.Context, b types.Deli Context: ctx, ID: r.renderElementID(b.Attributes), Kind: kind, - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Title: r.renderElementTitle(b.Attributes), Icon: icon, Content: content, @@ -315,7 +331,10 @@ func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b types.Delimit if err != nil { return "", errors.Wrap(err, "unable to render example block content") } - + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } c, ok := b.Attributes.GetAsString(types.AttrCaption) if !ok { c = ctx.Attributes.GetAsStringWithDefault(types.AttrExampleCaption, "Example") @@ -343,7 +362,7 @@ func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b types.Delimit ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), Caption: caption.String(), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, ExampleNumber: number, Content: content, Elements: elements, @@ -358,7 +377,10 @@ func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b types.Delimited if err != nil { return "", errors.Wrap(err, "unable to render example block content") } - + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } err = r.quoteBlock.Execute(result, struct { Context *renderer.Context ID string @@ -371,7 +393,7 @@ func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b types.Delimited Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Attribution: newDelimitedBlockAttribution(b), Content: content, Elements: b.Elements, @@ -383,7 +405,10 @@ func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.Delimited result := &strings.Builder{} elements := discardTrailingBlankLines(b.Elements) content := &strings.Builder{} - + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } for _, item := range elements { s, err := r.renderVerseBlockElement(ctx, item) if err != nil { @@ -391,7 +416,7 @@ func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.Delimited } content.WriteString(s) } - err := r.verseBlock.Execute(result, struct { + err = r.verseBlock.Execute(result, struct { Context *renderer.Context ID string Title string @@ -403,7 +428,7 @@ func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.Delimited Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Attribution: newDelimitedBlockAttribution(b), Content: string(content.String()), Elements: elements, @@ -435,7 +460,10 @@ func (r *sgmlRenderer) renderSidebarBlock(ctx *renderer.Context, b types.Delimit if err != nil { return "", errors.Wrap(err, "unable to render sidebar block content") } - + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } err = r.sidebarBlock.Execute(result, struct { Context *renderer.Context ID string @@ -447,7 +475,7 @@ func (r *sgmlRenderer) renderSidebarBlock(ctx *renderer.Context, b types.Delimit Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Content: content, Elements: discardTrailingBlankLines(b.Elements), }) @@ -461,6 +489,10 @@ func (r *sgmlRenderer) renderPassthrough(ctx *renderer.Context, b types.Delimite if err != nil { return "", errors.Wrap(err, "unable to render passthrough") } + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } err = r.passthroughBlock.Execute(result, struct { Context *renderer.Context ID string @@ -470,7 +502,7 @@ func (r *sgmlRenderer) renderPassthrough(ctx *renderer.Context, b types.Delimite }{ Context: ctx, ID: r.renderElementID(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Content: content, Elements: elements, }) diff --git a/pkg/renderer/sgml/element_role.go b/pkg/renderer/sgml/element_role.go index 54c33625..890fef4e 100644 --- a/pkg/renderer/sgml/element_role.go +++ b/pkg/renderer/sgml/element_role.go @@ -1,38 +1,88 @@ package sgml import ( - "html/template" + "fmt" "strings" "github.com/bytesparadise/libasciidoc/pkg/types" ) -func (r *sgmlRenderer) renderElementRoles(attrs types.Attributes) string { - switch r := attrs[types.AttrRole].(type) { - case []string: - return string(template.HTMLEscapeString(strings.Join(r, " "))) - case string: - return string(template.HTMLEscapeString(r)) - default: - return "" +func (r *sgmlRenderer) renderElementRoles(attrs types.Attributes) (string, error) { + var roles []string + switch role := attrs[types.AttrRole].(type) { + case []interface{}: + for _, er := range role { + switch er := er.(type) { + case types.ElementRole: + s, err := r.renderElementRole(er) + if err != nil { + return "", err + } + roles = append(roles, s) + default: + return "", fmt.Errorf("unpected type of element in role: '%T'", er) + } + } + case types.ElementRole: + s, err := r.renderElementRole(role) + if err != nil { + return "", err + } + roles = append(roles, s) } + return strings.Join(roles, " "), nil } // Image roles add float and alignment attributes -- we turn these into roles. -func (r *sgmlRenderer) renderImageRoles(attrs types.Attributes) string { +func (r *sgmlRenderer) renderImageRoles(attrs types.Attributes) (string, error) { var roles []string - if val, ok := attrs.GetAsString(types.AttrFloat); ok { roles = append(roles, val) } if val, ok := attrs.GetAsString(types.AttrImageAlign); ok { roles = append(roles, "text-"+val) } - switch r := attrs[types.AttrRole].(type) { - case []string: - roles = append(roles, r...) - case string: - roles = append(roles, r) + switch role := attrs[types.AttrRole].(type) { + case []interface{}: + for _, er := range role { + switch er := er.(type) { + case types.ElementRole: + s, err := r.renderElementRole(er) + if err != nil { + return "", err + } + roles = append(roles, s) + default: + return "", fmt.Errorf("unpected type of element in role: '%T'", er) + } + } + case types.ElementRole: + s, err := r.renderElementRole(role) + if err != nil { + return "", err + } + roles = append(roles, s) + } + return strings.Join(roles, " "), nil +} + +func (r *sgmlRenderer) renderElementRole(role types.ElementRole) (string, error) { + result := strings.Builder{} + for _, e := range role { + switch e := e.(type) { + case string: + result.WriteString(e) + case types.StringElement: + result.WriteString(e.Content) + case types.SpecialCharacter: + s, err := r.renderSpecialCharacter(e) + if err != nil { + return "", err + } + result.WriteString(s) + default: + return "", fmt.Errorf("unexpected type of element while rendering elemenr role: '%T'", e) + } } - return string(template.HTMLEscapeString(strings.Join(roles, " "))) + return result.String(), nil } diff --git a/pkg/renderer/sgml/elements.go b/pkg/renderer/sgml/elements.go index 835c9975..df5dbc5b 100644 --- a/pkg/renderer/sgml/elements.go +++ b/pkg/renderer/sgml/elements.go @@ -152,7 +152,7 @@ func (r *sgmlRenderer) renderPlainText(ctx *renderer.Context, element interface{ if alt, ok := element.Attributes[types.AttrInlineLinkText].([]interface{}); ok { return r.renderPlainText(ctx, alt) } - return element.Location.String(), nil + return element.Location.Stringify(), nil case types.BlankLine, types.ThematicBreak: return "\n\n", nil case types.StringElement: diff --git a/pkg/renderer/sgml/html5/image_test.go b/pkg/renderer/sgml/html5/image_test.go index e15f74e2..3cc64f8c 100644 --- a/pkg/renderer/sgml/html5/image_test.go +++ b/pkg/renderer/sgml/html5/image_test.go @@ -102,7 +102,8 @@ var _ = Describe("images", func() { It("block image with alt and dimensions and multiple roles", func() { - source := "[.role1.role2]\nimage::foo.png[foo image, 600, 400]" + source := `[.role1.role2] +image::foo.png[foo image, 600, 400]` expected := `
foo image diff --git a/pkg/renderer/sgml/html5/quoted_string_test.go b/pkg/renderer/sgml/html5/quoted_string_test.go index 3f15ef05..40d051c5 100644 --- a/pkg/renderer/sgml/html5/quoted_string_test.go +++ b/pkg/renderer/sgml/html5/quoted_string_test.go @@ -181,7 +181,7 @@ var _ = Describe("quoted strings", func() { It("image in curly", func() { source := "'`a image:foo.png[]`'" expected := `
-

‘a

+

‘a foo

` Expect(RenderHTML(source)).To(MatchHTML(expected)) @@ -335,7 +335,7 @@ var _ = Describe("quoted strings", func() { It("double curly in link (becomes mono)", func() { source := "https://www.example.com/a[\"`example`\"]" expected := ` ` Expect(RenderHTML(source)).To(MatchHTML(expected)) @@ -354,7 +354,7 @@ var _ = Describe("quoted strings", func() { It("image in double curly", func() { source := "\"`a image:foo.png[]`\"" expected := `
-

“a

+

“a foo

` Expect(RenderHTML(source)).To(MatchHTML(expected)) diff --git a/pkg/renderer/sgml/html5/quoted_text_test.go b/pkg/renderer/sgml/html5/quoted_text_test.go index 887848ad..a74bfefe 100644 --- a/pkg/renderer/sgml/html5/quoted_text_test.go +++ b/pkg/renderer/sgml/html5/quoted_text_test.go @@ -446,7 +446,7 @@ content.

It("quoted short-hand role", func() { source := "[.'something \"wicked\"']**bold**" expected := `
-

bold

+

bold

` Expect(RenderHTML(source)).To(MatchHTML(expected)) @@ -741,6 +741,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in double bold", func() { source := "this **mother's mothers' mothers`'**\n" expected := "
\n" + @@ -748,6 +749,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in single italic", func() { source := "this _mother's mothers' mothers`'_\n" expected := "
\n" + @@ -755,6 +757,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in double italic", func() { source := "this __mother's mothers' mothers`'__\n" expected := "
\n" + @@ -762,6 +765,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in single mono", func() { source := "this `mother's mothers' day`\n" // no typographic quotes here expected := "
\n" + @@ -769,6 +773,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in double mono", func() { source := "this ``mother's mothers' mothers`' day``\n" expected := "
\n" + @@ -776,6 +781,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in single marked", func() { source := "this #mother's mothers' mothers`'#\n" expected := "
\n" + @@ -783,6 +789,7 @@ b

"
\n" Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + It("apostrophes in double marked", func() { source := "this ##mother's mothers' mothers`'##\n" expected := "
\n" + diff --git a/pkg/renderer/sgml/image.go b/pkg/renderer/sgml/image.go index 2cef35e4..bdf4d0b8 100644 --- a/pkg/renderer/sgml/image.go +++ b/pkg/renderer/sgml/image.go @@ -35,7 +35,11 @@ func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBl } caption.WriteString(c) } - err := r.blockImage.Execute(result, struct { + roles, err := r.renderImageRoles(img.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render image roles") + } + err = r.blockImage.Execute(result, struct { ID string Title string ImageNumber int @@ -51,12 +55,12 @@ func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBl Title: title, ImageNumber: number, Caption: caption.String(), - Roles: r.renderImageRoles(img.Attributes), + Roles: roles, Href: img.Attributes.GetAsStringWithDefault(types.AttrInlineLink, ""), Alt: img.Attributes.GetAsStringWithDefault(types.AttrImageAlt, ""), Width: img.Attributes.GetAsStringWithDefault(types.AttrWidth, ""), Height: img.Attributes.GetAsStringWithDefault(types.AttrImageHeight, ""), - Path: img.Location.String(), + Path: img.Location.Stringify(), }) if err != nil { @@ -68,7 +72,11 @@ func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBl func (r *sgmlRenderer) renderInlineImage(img types.InlineImage) (string, error) { result := &strings.Builder{} - err := r.inlineImage.Execute(result, struct { + roles, err := r.renderImageRoles(img.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render image roles") + } + err = r.inlineImage.Execute(result, struct { Roles string Title string Href string @@ -78,11 +86,11 @@ func (r *sgmlRenderer) renderInlineImage(img types.InlineImage) (string, error) Path string }{ Title: r.renderElementTitle(img.Attributes), - Roles: r.renderImageRoles(img.Attributes), + Roles: roles, Alt: img.Attributes.GetAsStringWithDefault(types.AttrImageAlt, ""), Width: img.Attributes.GetAsStringWithDefault(types.AttrWidth, ""), Height: img.Attributes.GetAsStringWithDefault(types.AttrImageHeight, ""), - Path: img.Location.String(), + Path: img.Location.Stringify(), }) if err != nil { diff --git a/pkg/renderer/sgml/labeled_list.go b/pkg/renderer/sgml/labeled_list.go index 2468cdab..8985a890 100644 --- a/pkg/renderer/sgml/labeled_list.go +++ b/pkg/renderer/sgml/labeled_list.go @@ -22,7 +22,10 @@ func (r *sgmlRenderer) renderLabeledList(ctx *renderer.Context, l types.LabeledL return "", errors.Wrap(err, "unable to render unordered list") } } - + roles, err := r.renderElementRoles(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render labeled list roles") + } result := &strings.Builder{} // here we must preserve the HTML tags err = tmpl.Execute(result, struct { @@ -36,7 +39,7 @@ func (r *sgmlRenderer) renderLabeledList(ctx *renderer.Context, l types.LabeledL Context: ctx, ID: r.renderElementID(l.Attributes), Title: r.renderElementTitle(l.Attributes), - Roles: r.renderElementRoles(l.Attributes), + Roles: roles, Content: string(content.String()), Items: l.Items, }) diff --git a/pkg/renderer/sgml/link.go b/pkg/renderer/sgml/link.go index 9c3d3a49..1cfb36ab 100644 --- a/pkg/renderer/sgml/link.go +++ b/pkg/renderer/sgml/link.go @@ -11,7 +11,7 @@ import ( func (r *sgmlRenderer) renderLink(ctx *renderer.Context, l types.InlineLink) (string, error) { //nolint: unparam result := &strings.Builder{} - location := l.Location.String() + location := l.Location.Stringify() text := "" class := "" var err error diff --git a/pkg/renderer/sgml/literal_blocks.go b/pkg/renderer/sgml/literal_blocks.go index 620f6e29..cee202af 100644 --- a/pkg/renderer/sgml/literal_blocks.go +++ b/pkg/renderer/sgml/literal_blocks.go @@ -39,8 +39,12 @@ func (r *sgmlRenderer) renderLiteralBlock(ctx *renderer.Context, b types.Literal } else { lines = b.Lines } + roles, err := r.renderElementRoles(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render literal block roles") + } result := &strings.Builder{} - err := r.literalBlock.Execute(result, struct { + err = r.literalBlock.Execute(result, struct { Context *renderer.Context ID string Title string @@ -52,7 +56,7 @@ func (r *sgmlRenderer) renderLiteralBlock(ctx *renderer.Context, b types.Literal Context: ctx, ID: r.renderElementID(b.Attributes), Title: r.renderElementTitle(b.Attributes), - Roles: r.renderElementRoles(b.Attributes), + Roles: roles, Lines: lines, Content: strings.Join(lines, "\n"), }) diff --git a/pkg/renderer/sgml/ordered_list.go b/pkg/renderer/sgml/ordered_list.go index 280a0fc1..a1398c53 100644 --- a/pkg/renderer/sgml/ordered_list.go +++ b/pkg/renderer/sgml/ordered_list.go @@ -18,8 +18,11 @@ func (r *sgmlRenderer) renderOrderedList(ctx *renderer.Context, l types.OrderedL return "", errors.Wrap(err, "unable to render unordered list") } } - - err := r.orderedList.Execute(result, struct { + roles, err := r.renderElementRoles(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render ordered list roles") + } + err = r.orderedList.Execute(result, struct { Context *renderer.Context ID string Title string @@ -33,7 +36,7 @@ func (r *sgmlRenderer) renderOrderedList(ctx *renderer.Context, l types.OrderedL }{ ID: r.renderElementID(l.Attributes), Title: r.renderElementTitle(l.Attributes), - Roles: r.renderElementRoles(l.Attributes), + Roles: roles, Style: getNumberingStyle(l), ListStyle: r.numberingType(getNumberingStyle(l)), Start: l.Attributes.GetAsStringWithDefault(types.AttrStart, ""), diff --git a/pkg/renderer/sgml/paragraph.go b/pkg/renderer/sgml/paragraph.go index 70c948ac..e3b78b01 100644 --- a/pkg/renderer/sgml/paragraph.go +++ b/pkg/renderer/sgml/paragraph.go @@ -13,7 +13,6 @@ func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) result := &strings.Builder{} hardbreaks := p.Attributes.Has(types.AttrHardBreaks) || ctx.Attributes.Has(types.DocumentAttrHardBreaks) || p.Attributes.HasOption(types.AttrHardBreaks) content, err := r.renderLines(ctx, p.Lines, r.withHardBreaks(hardbreaks)) - if err != nil { return "", errors.Wrap(err, "unable to render paragraph content") } @@ -30,6 +29,10 @@ func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) } else if ctx.WithinDelimitedBlock || ctx.WithinList > 0 { return r.renderDelimitedBlockParagraph(ctx, p) } else { + roles, err := r.renderElementRoles(p.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render paragraph roles") + } log.Debug("rendering a standalone paragraph") err = r.paragraph.Execute(result, struct { Context *renderer.Context @@ -43,7 +46,7 @@ func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) ID: r.renderElementID(p.Attributes), Title: r.renderElementTitle(p.Attributes), Content: string(content), - Roles: r.renderElementRoles(p.Attributes), + Roles: roles, Lines: p.Lines, }) } @@ -69,6 +72,10 @@ func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types. if err != nil { return "", err } + roles, err := r.renderElementRoles(p.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render fenced block content") + } err = r.admonitionParagraph.Execute(result, struct { Context *renderer.Context ID string @@ -83,7 +90,7 @@ func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types. ID: r.renderElementID(p.Attributes), Title: r.renderElementTitle(p.Attributes), Kind: string(k), - Roles: r.renderElementRoles(p.Attributes), + Roles: roles, Icon: icon, Content: string(content), Lines: p.Lines, diff --git a/pkg/renderer/sgml/quoted_text.go b/pkg/renderer/sgml/quoted_text.go index 32038d1e..8ef86637 100644 --- a/pkg/renderer/sgml/quoted_text.go +++ b/pkg/renderer/sgml/quoted_text.go @@ -39,9 +39,12 @@ func (r *sgmlRenderer) renderQuotedText(ctx *renderer.Context, t types.QuotedTex default: return "", errors.Errorf("unsupported quoted text kind: '%v'", t.Kind) } - + roles, err := r.renderElementRoles(t.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render quoted text roles") + } result := &strings.Builder{} - err := tmpl.Execute(result, struct { + err = tmpl.Execute(result, struct { ID string Roles string Attributes types.Attributes @@ -49,7 +52,7 @@ func (r *sgmlRenderer) renderQuotedText(ctx *renderer.Context, t types.QuotedTex }{ Attributes: t.Attributes, ID: r.renderElementID(t.Attributes), - Roles: r.renderElementRoles(t.Attributes), + Roles: roles, Content: string(elementsBuffer.String()), }) //nolint: gosec if err != nil { diff --git a/pkg/renderer/sgml/renderer.go b/pkg/renderer/sgml/renderer.go index c68b7419..8a113b3b 100644 --- a/pkg/renderer/sgml/renderer.go +++ b/pkg/renderer/sgml/renderer.go @@ -158,6 +158,10 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output if err != nil { return md, errors.Wrapf(err, "unable to render full document") } + roles, err := r.renderDocumentRoles(doc) + if err != nil { + return md, errors.Wrap(err, "unable to render fenced block content") + } if ctx.Config.IncludeHeaderFooter { log.Debugf("Rendering full document...") err = r.article.Execute(output, struct { @@ -181,7 +185,7 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output Title: renderedTitle, Authors: r.renderAuthors(doc), Header: renderedHeader, - Roles: r.renderDocumentRoles(doc), + Roles: roles, ID: r.renderDocumentID(doc), Content: string(renderedContent), //nolint: gosec RevNumber: doc.Attributes.GetAsStringWithDefault("revnumber", ""), @@ -274,11 +278,11 @@ func (r *sgmlRenderer) splitAndRenderForManpage(ctx *renderer.Context, doc types return "", result.String(), nil } -func (r *sgmlRenderer) renderDocumentRoles(doc types.Document) string { +func (r *sgmlRenderer) renderDocumentRoles(doc types.Document) (string, error) { if header, found := doc.Header(); found { return r.renderElementRoles(header.Attributes) } - return "" + return "", nil } func (r *sgmlRenderer) renderDocumentID(doc types.Document) string { diff --git a/pkg/renderer/sgml/section.go b/pkg/renderer/sgml/section.go index 453b9f87..a80738fc 100644 --- a/pkg/renderer/sgml/section.go +++ b/pkg/renderer/sgml/section.go @@ -46,6 +46,10 @@ func (r *sgmlRenderer) renderSection(ctx *renderer.Context, s types.Section) (st if err != nil { return "", errors.Wrap(err, "error while rendering section content") } + roles, err := r.renderElementRoles(s.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render section roles") + } result := &strings.Builder{} err = r.sectionContent.Execute(result, struct { @@ -62,7 +66,7 @@ func (r *sgmlRenderer) renderSection(ctx *renderer.Context, s types.Section) (st Level: s.Level, Elements: s.Elements, ID: r.renderElementID(s.Attributes), - Roles: r.renderElementRoles(s.Attributes), + Roles: roles, Content: string(content), }) if err != nil { @@ -78,6 +82,11 @@ func (r *sgmlRenderer) renderSectionTitle(ctx *renderer.Context, s types.Section if err != nil { return "", errors.Wrap(err, "error while rendering sectionTitle content") } + roles, err := r.renderElementRoles(s.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render section content") + } + renderedContentStr := strings.TrimSpace(renderedContent) err = r.sectionHeader.Execute(result, struct { Level int @@ -89,7 +98,7 @@ func (r *sgmlRenderer) renderSectionTitle(ctx *renderer.Context, s types.Section Level: s.Level, LevelPlusOne: s.Level + 1, // Level 1 is

. ID: r.renderElementID(s.Attributes), - Roles: r.renderElementRoles(s.Attributes), + Roles: roles, Content: renderedContentStr, }) if err != nil { diff --git a/pkg/renderer/sgml/table.go b/pkg/renderer/sgml/table.go index f8820cac..98fe8d25 100644 --- a/pkg/renderer/sgml/table.go +++ b/pkg/renderer/sgml/table.go @@ -71,6 +71,10 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string if err != nil { return "", errors.Wrap(err, "failed to render table") } + roles, err := r.renderElementRoles(t.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render table roles") + } err = r.table.Execute(result, struct { Context *renderer.Context @@ -93,7 +97,7 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string Columns: t.Columns, TableNumber: number, Caption: caption.String(), - Roles: r.renderElementRoles(t.Attributes), + Roles: roles, Frame: frame, Grid: grid, Fit: fit, diff --git a/pkg/renderer/sgml/unordered_list.go b/pkg/renderer/sgml/unordered_list.go index 611b6dc6..60457ca0 100644 --- a/pkg/renderer/sgml/unordered_list.go +++ b/pkg/renderer/sgml/unordered_list.go @@ -25,8 +25,13 @@ func (r *sgmlRenderer) renderUnorderedList(ctx *renderer.Context, l types.Unorde return "", errors.Wrap(err, "unable to render unordered list") } } + roles, err := r.renderElementRoles(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render unordered list roles") + } + // here we must preserve the HTML tags - err := r.unorderedList.Execute(result, struct { + err = r.unorderedList.Execute(result, struct { Context *renderer.Context ID string Title string @@ -42,7 +47,7 @@ func (r *sgmlRenderer) renderUnorderedList(ctx *renderer.Context, l types.Unorde Checklist: checkList, Items: l.Items, Content: string(content.String()), - Roles: r.renderElementRoles(l.Attributes), + Roles: roles, Style: r.renderElementStyle(l.Attributes), }) if err != nil { diff --git a/pkg/renderer/sgml/xhtml5/quoted_string_test.go b/pkg/renderer/sgml/xhtml5/quoted_string_test.go index c1e3d8f8..54e8f2f6 100644 --- a/pkg/renderer/sgml/xhtml5/quoted_string_test.go +++ b/pkg/renderer/sgml/xhtml5/quoted_string_test.go @@ -173,7 +173,7 @@ var _ = Describe("quoted strings", func() { It("image in curly", func() { source := "'`a image:foo.png[]`'" expected := `
-

‘a

+

‘a foo

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) @@ -327,7 +327,7 @@ var _ = Describe("quoted strings", func() { It("double curly in link (becomes mono)", func() { source := "https://www.example.com/a[\"`example`\"]" expected := ` ` Expect(RenderXHTML(source)).To(MatchHTML(expected)) @@ -346,7 +346,7 @@ var _ = Describe("quoted strings", func() { It("image in double curly", func() { source := "\"`a image:foo.png[]`\"" expected := `
-

“a

+

“a foo

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) diff --git a/pkg/renderer/sgml/xhtml5/quoted_text_test.go b/pkg/renderer/sgml/xhtml5/quoted_text_test.go index 5377b187..1152bb31 100644 --- a/pkg/renderer/sgml/xhtml5/quoted_text_test.go +++ b/pkg/renderer/sgml/xhtml5/quoted_text_test.go @@ -250,7 +250,7 @@ var _ = Describe("quoted texts", func() { It("quoted short-hand role", func() { source := "[.'something \"wicked\"']**bold**" expected := `
-

bold

+

bold

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) diff --git a/pkg/types/attributes.go b/pkg/types/attributes.go index 4de12a0d..387c49d5 100644 --- a/pkg/types/attributes.go +++ b/pkg/types/attributes.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) @@ -132,8 +133,12 @@ const ( ) // NewElementID initializes a new attribute map with a single entry for the ID using the given value -func NewElementID(id string) (Attributes, error) { +func NewElementID(id interface{}) (Attributes, error) { // log.Debugf("initializing a new ElementID with ID=%s", id) + id, err := Reduce(id) + if err != nil { + return nil, err + } return Attributes{ AttrID: id, AttrCustomID: true, @@ -141,16 +146,31 @@ func NewElementID(id string) (Attributes, error) { } // NewElementOption sets a boolean option. -func NewElementOption(opt string) (Attributes, error) { - return Attributes{AttrOptions: opt}, nil +func NewElementOption(options interface{}) (Attributes, error) { + options, err := Reduce(options) + if err != nil { + return nil, err + } + return Attributes{ + AttrOptions: options, + }, nil } // NewElementNamedAttr a named (or positional) element -func NewElementNamedAttr(key string, value string) (Attributes, error) { +func NewElementNamedAttr(key string, value interface{}) (Attributes, error) { + value, err := Reduce(value) + if err != nil { + return nil, err + } if key == AttrOpts { // Handle the alias key = AttrOptions } - return Attributes{key: value}, nil + switch key { + case AttrRole: + return Attributes{key: ElementRole{value}}, nil + default: + return Attributes{key: value}, nil + } } // NewInlineElementID initializes a new attribute map with a single entry for the ID using the given value @@ -167,16 +187,33 @@ func NewElementTitle(title string) (Attributes, error) { }, nil } +type ElementRole []interface{} + // NewElementRole initializes a new attribute map with a single entry for the title using the given value -func NewElementRole(role string) (Attributes, error) { +func NewElementRole(role interface{}) (Attributes, error) { // log.Debugf("initializing a new ElementRole with content=%s", role) - return Attributes{ - AttrRole: role, - }, nil + role, err := Reduce(role) + if err != nil { + return nil, err + } + switch role := role.(type) { + case []interface{}: + return Attributes{ + AttrRole: ElementRole(role), // convert + }, nil + default: + return Attributes{ + AttrRole: ElementRole{role}, // wrap + }, nil + } } // NewElementStyle initializes a new attribute map with a single entry for the style -func NewElementStyle(style string) (Attributes, error) { +func NewElementStyle(style interface{}) (Attributes, error) { + style, err := Reduce(style) + if err != nil { + return nil, err + } return Attributes{AttrStyle: style}, nil } @@ -187,14 +224,18 @@ func NewAdmonitionAttribute(k AdmonitionKind) (Attributes, error) { // NewAttributeGroup initializes a group of attributes from the given generic attributes. func NewAttributeGroup(attributes []interface{}) (Attributes, error) { - // log.Debugf("initializing a new AttributeGroup with %v", attributes) + log.Debugf("initializing a new AttributeGroup with %v", attributes) result := make(Attributes) for _, a := range attributes { // log.Debugf("processing attribute element of type %T", a) if a, ok := a.(Attributes); ok { for k, v := range a { - // log.Debugf("adding attribute %v='%v'", k, v) - result[k] = v + switch k { + case AttrRole: + result[k] = ElementRole{v} + default: + result[k] = v + } } } else { return result, errors.Errorf("unable to process element of type '%[1]T': '%[1]s'", a) @@ -323,28 +364,28 @@ func (a Attributes) HasOption(key string) bool { return false } -// AppendString sets the value as a singular string value if it did not exist yet, -// or move the existing value in a slice of strings and append the new one -func (a Attributes) AppendString(key string, value interface{}) { +// sets the value as a singular string value if it did not exist yet, +// or move the existing value in a slice and append the new one +func (a Attributes) append(key string, value interface{}) { v, found := a[key] if !found { a[key] = value return } switch v := v.(type) { - case string: + case []interface{}: switch value := value.(type) { - case string: - a[key] = []string{v, value} // move existing value in a slice, along with the new one - case []string: - a[key] = append([]string{v}, value...) + case []interface{}: + a[key] = append(v, value...) + default: + a[key] = append(v, value) // just append the new value into the slice } - case []string: + default: switch value := value.(type) { - case string: - a[key] = append(v, value) // just append the new value into the slice - case []string: - a[key] = append(v, value...) + case []interface{}: + a[key] = append([]interface{}{v}, value...) + default: + a[key] = []interface{}{v, value} // move existing value in a slice, along with the new one } } } @@ -467,7 +508,10 @@ func NewElementAttributes(attributes ...interface{}) (Attributes, error) { if len(attributes) == 0 { return nil, nil } - + if log.IsLevelEnabled(log.DebugLevel) { + log.Debug("new element attributes:") + spew.Fdump(log.StandardLogger().Out, attributes) + } var err error result := Attributes{} for _, item := range attributes { @@ -495,7 +539,7 @@ func NewElementAttributes(attributes ...interface{}) (Attributes, error) { result[AttrCustomID] = true } case AttrRole: - result.AppendString(AttrRole, v) // grammar only generates string values + result.append(AttrRole, v) case AttrOptions, AttrOpts: if !result.Has(AttrOptions) { result[AttrOptions] = map[string]bool{} @@ -524,7 +568,7 @@ func NewElementAttributes(attributes ...interface{}) (Attributes, error) { } func resolveAlt(path Location) string { - _, filename := filepath.Split(path.String()) + _, filename := filepath.Split(path.Stringify()) ext := filepath.Ext(filename) if ext != "" { return strings.TrimSuffix(filename, ext) diff --git a/pkg/types/non_alphanumerics_replacement.go b/pkg/types/non_alphanumerics_replacement.go index 40345a2b..c6e7108b 100644 --- a/pkg/types/non_alphanumerics_replacement.go +++ b/pkg/types/non_alphanumerics_replacement.go @@ -33,7 +33,7 @@ func ReplaceNonAlphanumerics(elements []interface{}, replacement string) (string } buf.WriteString(r) case InlineLink: - r, err := replaceNonAlphanumerics(element.Location.String(), replacement) + r, err := replaceNonAlphanumerics(element.Location.Stringify(), replacement) if err != nil { return "", err } diff --git a/pkg/types/types.go b/pkg/types/types.go index bff45a7b..31b95b18 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -496,7 +496,6 @@ func NewSection(level int, title []interface{}, ids []interface{}, attributes in // multiple IDs can be defined (by mistake), but only the last one is used for _, id := range ids { attrs = attrs.Add(id) - } return Section{ Level: level, @@ -509,6 +508,7 @@ func NewSection(level int, title []interface{}, ids []interface{}, attributes in // ResolveID resolves/updates the "ID" attribute in the section (in case the title changed after some document attr substitution) func (s Section) ResolveID(docAttributes AttributesWithOverrides) (Section, error) { if !s.Attributes.GetAsBool(AttrCustomID) { + log.Debugf("resolving section id") replacement, err := ReplaceNonAlphanumerics(s.Title, "_") if err != nil { return s, errors.Wrapf(err, "failed to generate default ID on Section element") @@ -1217,12 +1217,11 @@ func NewExternalCrossReference(location Location, attributes Attributes) (Extern }, nil } -// ResolveLocation resolves the image path using the given document attributes -// also, updates the `alt` attribute based on the resolved path of the image -func (r ExternalCrossReference) ResolveLocation(attrs AttributesWithOverrides) ExternalCrossReference { - r.Location = r.Location.Resolve(attrs) - return r -} +// // ResolveLocation resolves the location using the given document attributes +// func (r ExternalCrossReference) ResolveLocation(attrs AttributesWithOverrides) ExternalCrossReference { +// r.Location = r.Location.Resolve(attrs) +// return r +// } // ------------------------------------------ // Images @@ -1235,7 +1234,7 @@ type ImageBlock struct { } // NewImageBlock initializes a new `ImageBlock` -func NewImageBlock(path Location, inlineAttributes Attributes, attributes interface{}) (ImageBlock, error) { +func NewImageBlock(location Location, inlineAttributes Attributes, attributes interface{}) (ImageBlock, error) { attrs, err := NewAttributes(attributes) if err != nil { return ImageBlock{}, errors.Wrapf(err, "failed to initialize an ImageBlock element") @@ -1246,22 +1245,25 @@ func NewImageBlock(path Location, inlineAttributes Attributes, attributes interf } else if len(inlineAttributes) > 0 { attrs = attrs.Add(inlineAttributes) } - return ImageBlock{ - Location: path, + Location: location, Attributes: attrs, }, nil } -// ResolveLocation resolves the image path using the given document attributes -// also, updates the `alt` attribute based on the resolved path of the image -func (b ImageBlock) ResolveLocation(attrs AttributesWithOverrides) ImageBlock { - b.Location = b.Location.Resolve(attrs) - if _, found := b.Attributes[AttrImageAlt]; !found { - b.Attributes = b.Attributes.Set(AttrImageAlt, resolveAlt(b.Location)) - } - return b -} +// // ResolveLocation resolves the image path using the given document attributes +// // also, updates the `alt` attribute based on the resolved path of the image +// func (b ImageBlock) ResolveLocation(attrs AttributesWithOverrides) ImageBlock { +// b.Location = b.Location.Resolve(attrs) +// if !b.Attributes.Has(AttrImageAlt) { +// b.Attributes = b.Attributes.Set(AttrImageAlt, resolveAlt(b.Location)) +// } +// // if log.IsLevelEnabled(log.DebugLevel) { +// // log.Debugf("resolved location: '%s'", b) +// // spew.Fdump(log.StandardLogger().Out, b) +// // } +// return b +// } // InlineImage the structure for the inline image macros type InlineImage struct { @@ -1270,30 +1272,30 @@ type InlineImage struct { } // NewInlineImage initializes a new `InlineImage` (similar to ImageBlock, but without attributes) -func NewInlineImage(path Location, attributes Attributes) (InlineImage, error) { +func NewInlineImage(location Location, attributes Attributes, imagesdir interface{}) (InlineImage, error) { + if !attributes.Has(AttrImageAlt) { + attributes = attributes.Set(AttrImageAlt, resolveAlt(location)) + } + location = location.WithPathPrefix(imagesdir) return InlineImage{ - Location: path, + Location: location, Attributes: attributes, }, nil } -// ResolveLocation resolves the image path using the given document attributes -// also, updates the `alt` attribute based on the resolved path of the image -func (i InlineImage) ResolveLocation(attrs AttributesWithOverrides) InlineImage { - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("resolving location") - spew.Fdump(log.StandardLogger().Out, i.Location.Path) - } - i.Location = i.Location.Resolve(attrs) - if _, found := i.Attributes[AttrImageAlt]; !found { - i.Attributes = i.Attributes.Set(AttrImageAlt, resolveAlt(i.Location)) - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("resolved location: '%s'", i) - spew.Fdump(log.StandardLogger().Out, i.Location.Path) - } - return i -} +// // ResolveLocation resolves the image path using the given document attributes +// // also, updates the `alt` attribute based on the resolved path of the image +// func (i InlineImage) ResolveLocation(attrs AttributesWithOverrides) InlineImage { +// i.Location = i.Location.Resolve(attrs) +// if !i.Attributes.Has(AttrImageAlt) { +// i.Attributes = i.Attributes.Set(AttrImageAlt, resolveAlt(i.Location)) +// } +// // if log.IsLevelEnabled(log.DebugLevel) { +// // log.Debugf("resolved location: '%s'", i) +// // spew.Fdump(log.StandardLogger().Out, i) +// // } +// return i +// } // ------------------------------------------ // Icons @@ -1428,7 +1430,9 @@ func (s *sequence) nextVal() int { // ------------------------------------------ // RawLine a line with raw content, read as-is by the parser (before further processing) -type RawLine = StringElement +type RawLine struct { + Content string +} // NewRawLine returns a new slice containing a single StringElement with the given content func NewRawLine(content string) (RawLine, error) { @@ -1846,6 +1850,12 @@ func NewInlineLink(url Location, attrs interface{}) (InlineLink, error) { return result, nil } +// // ResolveLocation resolves the location using the given document attributes +// func (l InlineLink) ResolveLocation(attrs AttributesWithOverrides) InlineLink { +// l.Location = l.Location.Resolve(attrs) +// return l +// } + // AttrInlineLinkText the link `text` attribute const AttrInlineLinkText string = "positional-1" @@ -2159,7 +2169,7 @@ type Location struct { // NewLocation return a new location with the given elements func NewLocation(scheme interface{}, path []interface{}) (Location, error) { path = Merge(path) - log.Debugf("new location: '%v' '%+v", scheme, path) + log.Debugf("new location: scheme='%v' path='%+v", scheme, path) s := "" if scheme, ok := scheme.([]byte); ok { s = string(scheme) @@ -2170,14 +2180,30 @@ func NewLocation(scheme interface{}, path []interface{}) (Location, error) { }, nil } -// Resolve resolves the Location by replacing all document attribute substitutions -// with their associated values, or their corresponding raw text if -// no attribute matched -// returns the resolved attribute -func (l Location) String() string { // (attrs map[string]string) string { +// WithPathPrefix adds the given prefix to the path if this latter is NOT an absolute +// path and if there is no defined scheme +func (l Location) WithPathPrefix(p interface{}) Location { + if p, ok := p.(string); ok && p != "" { + if l.Scheme == "" && !strings.HasPrefix(l.Stringify(), "/") { + if u, err := url.Parse(l.Stringify()); err == nil { + if !u.IsAbs() { + l.Path = append([]interface{}{ + StringElement{ + Content: p, + }, + }, l.Path...) + } + } + } + } + return l +} + +// Stringify returns a string representation of the location +func (l Location) Stringify() string { // (attrs map[string]string) string { result := bytes.NewBuffer(nil) result.WriteString(l.Scheme) - for _, e := range l.Path { + for i, 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 if s, ok := e.(StringElement); ok { @@ -2185,6 +2211,10 @@ func (l Location) String() string { // (attrs map[string]string) string { } else { result.WriteString(fmt.Sprintf("%s", e)) } + // include a "/" separator after each path element + if i < len(l.Path)-1 { + result.WriteString("/") + } } return result.String() } @@ -2196,6 +2226,10 @@ const imagesdir = "imagesdir" // no attribute matched // returns `true` if some document attribute substitution occurred func (l Location) Resolve(attrs AttributesWithOverrides) Location { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("resolving location using '%v'", attrs) + spew.Fdump(log.StandardLogger().Out, l.Path) + } content := bytes.NewBuffer(nil) for _, e := range l.Path { switch e := e.(type) { @@ -2207,16 +2241,15 @@ func (l Location) Resolve(attrs AttributesWithOverrides) Location { content.WriteString(e.Name) content.WriteRune('}') } + case string: + content.WriteString(e) // no need to use `fmt.Sprintf` for elements of type 'string' + case StringElement: + content.WriteString(e.Content) // no need to use `fmt.Sprintf` for elements of type 'string' default: - if s, ok := e.(string); ok { - content.WriteString(s) // no need to use `fmt.Sprintf` for elements of type 'string' - } else if s, ok := e.(StringElement); ok { - content.WriteString(s.Content) // no need to use `fmt.Sprintf` for elements of type 'string' - } else { - content.WriteString(fmt.Sprintf("%s", e)) - } + content.WriteString(fmt.Sprintf("%s", e)) } } + // location should remain an []interface{} and may contain SpecialCahracter elements location := content.String() if l.Scheme == "" && !strings.HasPrefix(location, "/") { if u, err := url.Parse(location); err == nil { @@ -2323,3 +2356,26 @@ func NewSpecialCharacter(name string) (SpecialCharacter, error) { Name: name, }, nil } + +// ------------------------------------------------------------------------------------ +// ElementPlaceHolder +// They need to be identified as they may have a special treatment during the rendering +// ------------------------------------------------------------------------------------ + +// ElementPlaceHolder a placeholder for elements which may have been parsed +// during previous substitution, and which are replaced with a placeholder while +// serializing the content to parse with the "macros" substitution +type ElementPlaceHolder struct { + Ref string +} + +// NewElementPlaceHolder returns a new ElementPlaceHolder with the given reference. +func NewElementPlaceHolder(ref string) (ElementPlaceHolder, error) { + return ElementPlaceHolder{ + Ref: ref, + }, nil +} + +func (p ElementPlaceHolder) String() string { + return "\uFFFD" + p.Ref + "\uFFFD" +} diff --git a/pkg/types/types_test.go b/pkg/types/types_test.go index 2593c714..8d15bc6e 100644 --- a/pkg/types/types_test.go +++ b/pkg/types/types_test.go @@ -482,7 +482,7 @@ var _ = Describe("location resolution", func() { func(actual types.Location, expected types.Location, expectedStr string) { actual = actual.Resolve(attrs) Expect(actual).To(Equal(expected)) - Expect(actual.String()).To(Equal(expectedStr)) + Expect(actual.Stringify()).To(Equal(expectedStr)) }, Entry("includes/file.ext", types.Location{ diff --git a/pkg/types/types_utils.go b/pkg/types/types_utils.go index afafa11c..9c7f8fca 100644 --- a/pkg/types/types_utils.go +++ b/pkg/types/types_utils.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "fmt" "github.com/pkg/errors" ) @@ -49,6 +50,24 @@ func appendBuffer(elements []interface{}, buf *bytes.Buffer) ([]interface{}, *by return elements, buf } +// Reduce merges and returns a string if the given elements only contain a single StringElement +// (ie, return its `Content`), otherwise rsturn the given elements +func Reduce(elements interface{}) (interface{}, error) { + if e, ok := elements.(string); ok { + return e, nil + } + if elmts, ok := elements.([]interface{}); ok { + elmts = Merge(elmts...) + if len(elmts) == 1 { + if e, ok := elmts[0].(StringElement); ok { + return e.Content, nil + } + } + return elements, nil + } + return nil, fmt.Errorf("unsupported type of items to reduce: '%T'", elements) +} + // applyFunc a function to apply on the result of the `apply` function below, before returning type applyFunc func(s string) string