Add support for NAME keyword

This commit is contained in:
Niklas Fasching 2019-10-27 15:04:55 +01:00
parent 2afd11581c
commit 20970ec872
8 changed files with 63 additions and 3 deletions

View file

@ -12,6 +12,7 @@ type Writer interface {
WriteInclude(Include)
WriteComment(Comment)
WriteNodeWithMeta(NodeWithMeta)
WriteNodeWithName(NodeWithName)
WriteHeadline(Headline)
WriteBlock(Block)
WriteExample(Example)
@ -46,6 +47,8 @@ func WriteNodes(w Writer, nodes ...Node) {
w.WriteComment(n)
case NodeWithMeta:
w.WriteNodeWithMeta(n)
case NodeWithName:
w.WriteNodeWithName(n)
case Headline:
w.WriteHeadline(n)
case Block:
@ -90,7 +93,7 @@ func WriteNodes(w Writer, nodes ...Node) {
w.WriteFootnoteDefinition(n)
default:
if n != nil {
panic(fmt.Sprintf("bad node %#v", n))
panic(fmt.Sprintf("bad node %T %#v", n, n))
}
}
}