lib/org-parse/node.rb in org-parse-0.1.1 vs lib/org-parse/node.rb in org-parse-0.1.2
- old
+ new
@@ -232,13 +232,14 @@
end
end
# BLOCK の情報を保持
class BlockNode < Node
- attr_reader :indent, :block_name, :syntax, :syntax_theme
+ attr_reader :indent, :block_name, :syntax, :syntax_theme, :filename, :type
def initialize(vals, children)
@block_name = vals[0].upcase
+ @line = vals[1]
@indent = vals[2]
@syntax = ''
@syntax_theme = ''
super(:BLOCK, children, vals[1])
case @block_name
@@ -251,9 +252,18 @@
if vals[1] =~ /SRC\s*([^\s]+)\s+([^\s]+)\s*$/i
@syntax = $1.downcase
@syntax_theme = $2.downcase
elsif vals[1] =~ /SRC\s*(.+)\s*$/i
@syntax = $1.downcase
+ end
+ when 'DOT'
+ set_to_descendant :set_src
+ if vals[1] =~ /DOT\s+(.+)\s+-T(.*)$/
+ @filename = $1
+ @type = $2
+ else
+ @block_name = 'SRC'
+ @syntax = 'dot'
end
when 'HTML'
set_to_descendant :set_html
end
end