You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bbsandbox/bristlecode_nodes.rb

38 lines
670 B
Ruby

9 years ago
module Bristlecode
class RootNode < Treetop::Runtime::SyntaxNode
def to_html
elements.each{|elem| elem.to_html}
end
end
class TextNode < Treetop::Runtime::SyntaxNode
def initialize(input, interval, elements)
@text = input[interval]
end
def text_value
@text
end
def inspect(indent="")
"#{indent}TextNode: #{text_value}"
end
def to_html
text_value
end
end
class BoldOpenNode < Treetop::Runtime::SyntaxNode
end
class BoldCloseNode < Treetop::Runtime::SyntaxNode
end
class BoldNode < Treetop::Runtime::SyntaxNode
end
class TagNode < Treetop::Runtime::SyntaxNode
end
end