Skip to content

Commit

Permalink
Rename BlockText to BlankNode
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Sep 17, 2024
1 parent edaafcc commit af5b3b5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import eu.iamgio.quarkdown.visitor.node.NodeVisitor
/**
* Any unknown node type (should not happen).
*/
data object BlockText : Node {
data object BlankNode : Node {
override fun <T> accept(visitor: NodeVisitor<T>) = visitor.visit(this)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package eu.iamgio.quarkdown.function.value.output.node
import eu.iamgio.quarkdown.ast.MarkdownContent
import eu.iamgio.quarkdown.ast.Node
import eu.iamgio.quarkdown.ast.base.block.BaseListItem
import eu.iamgio.quarkdown.ast.base.block.BlockText
import eu.iamgio.quarkdown.ast.base.block.BlankNode
import eu.iamgio.quarkdown.ast.base.block.ListItem
import eu.iamgio.quarkdown.ast.base.block.OrderedList
import eu.iamgio.quarkdown.ast.base.block.UnorderedList
Expand Down Expand Up @@ -53,7 +53,7 @@ abstract class NodeOutputValueVisitor : OutputValueVisitor<Node> {

override fun visit(value: NodeValue) = value.unwrappedValue

override fun visit(value: VoidValue) = BlockText
override fun visit(value: VoidValue) = BlankNode

// Dynamic output (e.g. produced by the stdlib function `.function`) is treated:
// - If it is a suitable output value: its content is visited again with this visitor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class BlockQuoteToken(data: TokenData) : Token(data) {
}

/**
* @see eu.iamgio.quarkdown.ast.base.block.BlockText
* @see eu.iamgio.quarkdown.ast.base.block.BlankNode
*/
class BlockTextToken(data: TokenData) : Token(data) {
override fun <T> accept(visitor: TokenVisitor<T>) = visitor.visit(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import eu.iamgio.quarkdown.ast.InlineContent
import eu.iamgio.quarkdown.ast.Node
import eu.iamgio.quarkdown.ast.base.TextNode
import eu.iamgio.quarkdown.ast.base.block.BaseListItem
import eu.iamgio.quarkdown.ast.base.block.BlankNode
import eu.iamgio.quarkdown.ast.base.block.BlockQuote
import eu.iamgio.quarkdown.ast.base.block.BlockText
import eu.iamgio.quarkdown.ast.base.block.Code
import eu.iamgio.quarkdown.ast.base.block.Heading
import eu.iamgio.quarkdown.ast.base.block.HorizontalRule
Expand Down Expand Up @@ -382,7 +382,7 @@ class BlockTokenParser(private val context: MutableContext) : BlockTokenVisitor<
}

override fun visit(token: BlockTextToken): Node {
return BlockText
return BlankNode
}

override fun visit(token: PageBreakToken): Node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package eu.iamgio.quarkdown.rendering.html

import eu.iamgio.quarkdown.ast.AstRoot
import eu.iamgio.quarkdown.ast.base.block.BaseListItem
import eu.iamgio.quarkdown.ast.base.block.BlankNode
import eu.iamgio.quarkdown.ast.base.block.BlockQuote
import eu.iamgio.quarkdown.ast.base.block.BlockText
import eu.iamgio.quarkdown.ast.base.block.Code
import eu.iamgio.quarkdown.ast.base.block.Heading
import eu.iamgio.quarkdown.ast.base.block.HorizontalRule
Expand Down Expand Up @@ -186,7 +186,7 @@ open class BaseHtmlNodeRenderer(context: Context) : TagNodeRenderer<HtmlTagBuild

override fun visit(node: BlockQuote) = buildTag("blockquote", node.children)

override fun visit(node: BlockText) = "" // Fallback block, should not happen
override fun visit(node: BlankNode) = "" // Fallback block, should not happen

// Inline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package eu.iamgio.quarkdown.visitor.node

import eu.iamgio.quarkdown.ast.AstRoot
import eu.iamgio.quarkdown.ast.base.block.BaseListItem
import eu.iamgio.quarkdown.ast.base.block.BlankNode
import eu.iamgio.quarkdown.ast.base.block.BlockQuote
import eu.iamgio.quarkdown.ast.base.block.BlockText
import eu.iamgio.quarkdown.ast.base.block.Code
import eu.iamgio.quarkdown.ast.base.block.Heading
import eu.iamgio.quarkdown.ast.base.block.HorizontalRule
Expand Down Expand Up @@ -83,7 +83,7 @@ interface NodeVisitor<T> {

fun visit(node: BlockQuote): T

fun visit(node: BlockText): T
fun visit(node: BlankNode): T

// Base inline

Expand Down
4 changes: 2 additions & 2 deletions stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib/Flow.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package eu.iamgio.quarkdown.stdlib

import eu.iamgio.quarkdown.ast.base.block.BlockText
import eu.iamgio.quarkdown.ast.base.block.BlankNode
import eu.iamgio.quarkdown.context.MutableContext
import eu.iamgio.quarkdown.context.ScopeContext
import eu.iamgio.quarkdown.function.FunctionParameter
Expand Down Expand Up @@ -199,4 +199,4 @@ fun let(
* in case the visible output does not match the expected one.
* @return an invisible mock node
*/
fun node(): NodeValue = BlockText.wrappedAsValue()
fun node(): NodeValue = BlankNode.wrappedAsValue()

0 comments on commit af5b3b5

Please sign in to comment.